michas
michas

Reputation: 26545

How to recognize a renamed file in Git?

I like reviewing changes using git log -p. This works well, but fails in case of renamed files. In that case it shows the one file completely red as deleted and the "other" file completely green as new. Therefore it is not easy to see any changes in the renamed file.

Is there a way to have something like git log -p that recognizes renamed files and shows the diff of the files?

I am aware of git log --follow, but this works only for single files, and is therefore not helpful for reviewing whole commits.

Upvotes: 3

Views: 91

Answers (1)

ogzd
ogzd

Reputation: 5692

git log -M -p
or
git log --find-renames --patch)

Upvotes: 5

Related Questions