Is HEAD in git case insensitive on all platforms?

前端 未结 4 1444
予麋鹿
予麋鹿 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:28

    Answering to cover Mac OSX (Mavericks):

    $ git checkout HEAD
    Your branch is up-to-date with 'origin/master'.
    

    but:

    $ git checkout head
    Note: checking out 'head'.
    
    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:
    
      git checkout -b new_branch_name
    
    HEAD is now at f44b740... fix if endScreen(s) not present
    

    By the way, that hash is the head of the current branch (in my test, the same has contained in .git/refs/heads/master)

    Interesting behaviour.

    (git 1.8.5.2)

提交回复
热议问题