Git 合并时 submodule 冲突问题解决方法

假如当前在 branchA,在执行 git merge branchB 时,可能会遇到子仓库文件冲突

可以尝试一下命令:

git update-index --cacheinfo 160000 <commit-hash> "<子仓库path>"

其中 <commit-hash> 改为 branchA 对应子仓库的 commit 哈希值

其中 <子仓库path> 为在 .gitmodules 配置的子仓库 path

关于 git update-index 的用法详见:https://cloud.tencent.com/developer/section/1138784

原文地址:https://www.cnblogs.com/savokiss/p/13642023.html