Tuesday 15 February 2011

git - See diff between current state and last commit -


Sometimes when I'm going to comment, I can not remember what happened since the last commitment Has changed. How can I see a difference between the current state of the code and the last committed?

If you have not yet entered any file in the index ( git add ), Simply

  git diff   

This will show the difference between your work tree and index.

If you have added files to the index, you have to show the difference between this indicator and the last committed (head). Finally, if you compare to the latest committed ( HEAD ) work tree in the

  git diff --cached   

Code> git diff --cached .

No comments:

Post a Comment