Reputation: 6582
My project history looks like this:
I want to view a diff of what the edits I made to the two files across these commits, but git diff rev0..rev3
isn't helpful because I just see the deletion of files a & b, and all of the edits to c & d as one big add mixed in with the creation of the files.
How can I see a diff including rev1 and rev3 where ((a,c), (b,d)) are treated as the same files, without the file rename clutter in the diff?
Upvotes: 3
Views: 133
Reputation: 7067
git diff
will accept arguments of the type <rev>:<filename
. Use git log --follow <file>
to find the revision you want, and the name of your file at that revision.
For example (on my code, it was converted to C++ in the past)
git diff 44308:./draw.c draw.cpp
for you it might be
git diff rev1:./a c
I found I needed to specify the path to the file, otherwise git itself gave me a hint.
Upvotes: 1
Reputation: 3271
Use git diff -M
.
It can also be fine-tuned - git diff -M90%
to detect files which are 90% similar. (Not sure what git status
uses by default)
Upvotes: 2
Reputation: 165192
git diff -C
will diff across renames, and also detect copies.
As mentioned in the answer above
git diff -M
detects just renames.
Upvotes: 2