I was testing on my local machine (OS-X 10.10) which uses a case insensitive file system (HFS+ [CI]) - when I reset to the head:
$ git reset head --hard
$ g
No, you would not get the same results on a case sensitive filesystem. If you ran:
git reset branch --head
on a case sensitive filesystem then that is not the same as running:
git reset BRANCH --hard
Since references are often stored on the filesystem (in the .git/refs/heads
folder), the case sensitivity of the filesystem comes into play. On a case sensitive filesystem, .git/refs/heads/branch
and .git/refs/heads/BRANCH
are two different files.
Note that even on a case insensitive filesystem, your references may end up "packed", in a file specifying on reference per line. In this case, your references are always case sensitive, regardless of your filesystem.