Your examples are not equivalent. If you do not specify a commit to compare against then the diff will contain working tree changes, staged or not.
So, git diff HEAD^
will include working tree changes in the commit, while git diff HEAD^ HEAD
will not include working tree changes and will only include the diff between the two commits.
HEAD^
, HEAD~
, HEAD^1
, and HEAD~1
are all identical. They all refer to the first parent of the HEAD
commit.
HEAD^^
, HEAD~~
, and HEAD~2
are identical, they all refer to the first parent of the first parent of the HEAD
commit. HEAD^2
is special - it refers the the second parent of the HEAD
commit, which is only useful if HEAD
is a merge commit.
More information here:
http://git-scm.com/book/ch6-1.html#Ancestry-References