最佳答案
I have a file a.txt
.
cat a.txt
> hello
The contents of a.txt
is "hello".
I make a commit.
git add a.txt
git commit -m "first commit"
I then move a.txt
into a test
dir.
mkdir test
mv a.txt test
I then make my second commit.
git add -A
git commit -m "second commit"
Finally, I edit a.txt
to say "goodbye" instead.
cat a.txt
> goodbye
I make my last commit.
git add a.txt
git commit -m "final commit"
Now here is my question:
How do I diff the contents of a.txt
between my last commit and my first commit?
I've tried:
git diff HEAD^^..HEAD -M a.txt
, but that didn't work. git log --follow a.txt
properly detects the rename, but I can't find an equivalent for git diff
. Is there one?