git diff¶
Diff commit before HEAD
and HEAD
:
$ git diff HEAD^ HEAD
$ git diff HEAD^..HEAD
$ git diff @^ @
$ git diff @^..@
Diff file.txt
from commit before HEAD
and HEAD
:
$ git diff HEAD^ HEAD -- file.txt
$ git diff HEAD^..HEAD -- file.txt
$ git diff @^ @ -- file.txt
$ git diff @^..@ -- file.txt
Just changes (no context, no diff markers):
$ git diff --unified=0 --color-words | grep -P -v "^[\x03-\x1F]\[(1|36)m"