How to make submodule with detached HEAD to be attached to actual HEAD?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I add a Git submodule to a Git repository like this, git submodule add ssh://server/proj1/ proj1 git submodule init git submodule update the added submodule will be in detached HEAD mode. I don't know well what that is, but I know that the submodule will be linked to specific revision of the target repository. I don't know how it actually works, anyway it looks like a proxy branch exists there. I solved this by switching to master branch. cd proj1 git checkout master This will switch current branch actual master HEAD, but this does not