How can I use Git to see in which commits a file was renamed?

Viewed 35

I don't want to see the whole history or diffs (so git log --follow filename is not I'm looking for).

I want to find out the commit ids in which a file might have been renamed, in order to figure out the date & time of the changes.

Can git do this? My Google Fu is weak, I couldn't find anything about this.

1 Answers

Try

git log --name-status --follow --diff-filter=R -- new_filename

--diff-filter=R matches commits which have renamed files. --follow and the new filename are also necessary. Without --follow, the commit that has the renaming is excluded.

Related