I am using Git on Ubuntu 10.04 (Lucid Lynx).
I have made some commits to my master.
However, I want to get the difference between these commits. All of
I use gitk
to see the difference:
gitk k73ud..dj374
It has a GUI mode so that reviewing is easier.
Use this command for the difference between commit and unstaged:
git difftool --dir-diff
Simplest for checking the changes in the last 2 commits after pull:
git diff HEAD~2
To see the difference between two different commits (let's call them a
and b
), use
git diff a..b
a
and b
is opposite from b
and a
.To see the difference between your last commit and not yet committed changes, use
git diff
If you want to be able to come back to the difference later, you can save it in a file.
git diff a..b > ../project.diff
gitk --all
Let's say you have one more commit at the bottom (oldest), then this becomes pretty easy:
commit dj374
made changes
commit y4746
made changes
commit k73ud
made changes
commit oldestCommit
made changes
Now, using below will easily server the purpose.
git diff k73ud oldestCommit