我想使用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 分支,而不是游离的 HEAD。我们该如何实现?