Skip to content

Instantly share code, notes, and snippets.

@skeggse
Last active August 29, 2015 14:01
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 skeggse/254e11f9ca361b139ddd to your computer and use it in GitHub Desktop.
Save skeggse/254e11f9ca361b139ddd to your computer and use it in GitHub Desktop.
git being git
/tmp$ mkdir gittest
/tmp$ cd gittest
/tmp/gittest$ git init
/tmp/gittest$ echo test > test
/tmp/gittest$ git add test
/tmp/gittest$ git commit -m test
/tmp/gittest$ git diff-index --quiet HEAD
/tmp/gittest$ echo $?
0
/tmp/gittest$ echo "another test" >> test
/tmp/gittest$ git diff-index --quiet HEAD
/tmp/gittest$ echo $?
1
/tmp/gittest$ echo test > test
/tmp/gittest$ git diff-index --quiet HEAD
/tmp/gittest$ echo $?
1 # what?
/tmp/gittest$ git status
/tmp/gittest$ git diff-index --quiet HEAD
/tmp/gittest$ echo $?
0 # expected...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment