Are GIT refs always case insensitive?

后端 未结 2 601
面向向阳花
面向向阳花 2021-01-18 09:57

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         


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 10:28

    Yes, they are case insensitive. No, a case sensitive file system will not matter. Because git refs are part of a SHA-1 hash, and those are hexadecimal digits (base-16, they just look like letters). At least for the commit-id. As pointed out by @EdwardThomson in the comments, a ref-name may (or may not) be case-sensitive (that depends on the underlying filesystem and whether or not the storage mechanism is loose or packed).

提交回复
热议问题