Using Git, how can you find the difference between the current and the last version?
git diff last version:HEAD
As the previous commit can be accessed with HEAD^:
git diff HEAD^ HEAD
In git version 1.8.5, @ is an alias for HEAD
git diff @[email protected]
One more way that you can use:
git show
To see the difference between head and commit using:
git diff commit_id HEAD
Since comparison to HEAD is default you can omit it for comparing with HEAD use:
git diff @^git diff HEAD^git diff commit_id
git diff @^
git diff HEAD^
git diff commit_id
Reference: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt-Comparingwitharbitrarycommits