Is HEAD in git case insensitive on all platforms?

前端 未结 4 1464
予麋鹿
予麋鹿 2021-01-11 16:07

Using msysgit on Windows, I can do this:

git checkout head

or

git checkout HEAD

Either works. I don\'t ha

4条回答
  •  既然无缘
    2021-01-11 16:35

    The case-sensitivity of HEAD is depending on the case-sensitivity of file system of the OS.

    When you checkout HEAD, git actually looks for a file named "HEAD" under the folder .git. If you type HEAD in small letters, git looks for the file name with small letters. You can see the .git/HEAD file actually contains the hash code of the commit HEAD pointing to.

    Because of this, the typical case-sensitivities of HEAD are:

    • Case-sensitive on Linux
    • Case-insensitive on Windows, MacOS

提交回复
热议问题