【发布时间】:2013-11-27 23:03:10
【问题描述】:
我正在尝试使用 git 子模块将 10 多个存储库聚合到一个结构中以便于开发。
它应该克隆模块并签出一个分支。 相反,模块以分离头模式签出。
git clone git@github.com:org/global-repository.git
git submodule update —init
cd config-framework
git status
$git status
#HEAD detached at b932ab5
nothing to commit, working directory clean
gitmodules 文件好像没问题
$cat .gitmodules
[submodule "config-framework"]
path = config-framework
url = git@github.com:org/config-framework.git
branch = MY_BRANCH
我们希望默认签出 MY_BRANCH 分支,而不是分离头。 我们如何做到这一点?
【问题讨论】:
-
这是子模块的工作方式。主项目引用特定的提交,而不是分支。
标签: git git-branch git-submodules git-remote