我正在嘗試使用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