what determines default branch when cloning from git bare repository

*爱你&永不变心* 提交于 2019-12-09 05:10:26

Old versions of git do not send the "default branch" when fetching and cloning. Instead, they send the object ID of the current HEAD reference, as well as the object ID of the other references. If the object ID of HEAD is the same as the object ID of another reference, it will set HEAD to point to that reference. (If there was no match, you will be in a detached HEAD state.)

The disambiguation logic is fuzzy, though, if you have more than one branch pointing to the same commit. It will prefer a branch named master, then it will simply pick the one it saw first.

Stop laughing, I'm serious.

This was fixed in Git 1.8.4.3.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!