http://*.com/questions/9903541/finding-diff-between-current-and-last-versions
|
As pointed out on a comment by amalloy, if by "current and last versions" you mean the last commit and the commit before that, you could simply use
git show
|
answered Oct 14 '15 at 17:46
|
|
|
|
|
|
|
|
Use git show HEAD~1 to show the last-but-one commit, and git show HEAD~2 , etc. for older commits. Show just a single file via git show HEAD~2 my_file . – Florian Brucker Mar 3 at 10:43
|
|
Assuming "current version" is the working directory (uncommitted modifications) and "last version" is HEAD (last committed modifications for the current branch), simply do
git diff HEAD
credit for following goes to user Cerran
And if you always skip the staging area with -a when you commit, then you can simply use git diff .
Summary
-
git diff shows unstaged changes.
-
git diff --cached shows staged changes.
-
git diff HEAD shows all changes (both staged and unstaged).
Source: git-diff(1) Manual Page – Cerran
|
|
answered Mar 28 '12 at 8:17
|
|
|
|
And if you always skip the staging area with -a when you commit, then you can simply use git diff . <1> git diff shows unstaged changes. <2> git diff --cached shows staged changes. <3> git diff HEAD shows all changes (both staged and unstaged). Source: git-diff(1) Manual Page – Cerran Feb 20 '14 at 13:16
|
|
|
|