Http://stackoverflow.com/questions/9903541/finding-diff-between-current-and-last-versions
| up vote47down vote |
As pointed out in A comment by amalloy, if by ' current and last versions ' you mean the last commit and the Commit before, could simply use git Show
| shareedit /td> |
answered oct "at 17:46 Nighto1,081< Span class= "Badge2" >921 |
|
|
|
|
This is the what I am looking for. Great answer. –codemaniak Jan at 22:50 |
| simpler. This should is the accepted Answer. – jbmusso mar 2 at 9:21 |
|
|
|
Use git show HEAD~1 to show the Last-but-one commits, 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" was the working directory (uncommitted modifications) and "last version" was HEAD (last Committe D Modifications for the current branch), simply do git diff HEAD
Following goes to userCerran And if you are always skip the staging area -a with when your commit, then you can simply use git diff . Summary
git diffShows unstaged changes.
git diff --cachedShows staged changes.
-
git diff HEAD shows all changes (both staged and unstaged).
Source:git-diff (1) Manual Page–cerran
| ShareEdit |
edited June 0:52 Dheeraj bhaskar11.7k 3< Span class= "Badge2" >3046 |
answered Mar ' at 8:17charlesb43.3k118141 |
|
|
and if you always skip th E staging Area with -a when you commit and then 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 13:16 |
|
|
|
This is a good summary. Could is an answer. –user3527975 4 at 18:11 |
|
Git to see the difference between current and previous version