我正在尝试使用git子模块将10个以上的存储库聚合到一个结构中以便于开发。Git子模块来跟踪远程分支
它应该克隆模块并签出一个分支。 取而代之的是,模块在分离头模式下检出。
git clone [email protected]: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 = [email protected]:org/config-framework.git
branch = MY_BRANCH
我们希望被默认选中的MY_BRANCH分支出来的,而不是分离的头。 我们如何实现这一目标?
这是子模块的工作方式。主项目引用特定的提交,而不是分支。 – twalberg