Why is “origin/HEAD” shown when running “git branch -r”?

后端 未结 7 1354
故里飘歌
故里飘歌 2020-11-28 01:16

When you run git branch -r why the blazes does it list origin/HEAD? For example, there\'s a remote repo on GitHub, say, with two branches: master a

7条回答
  •  天涯浪人
    2020-11-28 02:04

    The reason a bare repository can have a HEAD, is that because it determines which branch is initially checked out after a clone of the repository.

    Normally, HEAD points to master, and that is the branch that is checked out when people clone the repository. Setting it to another branch (by editing HEAD in the bare repository) results in that branch being checked out on clone.

提交回复
热议问题