Skip to content

Instantly share code, notes, and snippets.

@cirocosta
Created March 25, 2014 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirocosta/9760063 to your computer and use it in GitHub Desktop.
Save cirocosta/9760063 to your computer and use it in GitHub Desktop.
diffing with git

What changes i've made to the files which i didn't stage yet?

$ git diff

How does my staged files differs from the most recent commit?

$ git diff --staged

How could i see de differences between my working tree and the last commit?

$ git diff HEAD

This is all very cool, but what if i want to see, in a colored way, what are those single words that changed?

$ git diff --word-diff
$ git diff --color-words

OK. But i've changed so many things. Just want to see how much i changed per file. How to achieve that?

$ git diff --stat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment