解决子模块的合并冲突

问题

  • 试图合并
    git checkout develop
    git pull
    git checkout feature/branchname
    git merge develop
  • GitHub显示冲突
    This branch has conflicts that must be resolved
    to resolve conflicts before continuing.
    Conflicting files
    submodules/xxx
  • 命令行显示冲突
Failed to merge submodule submodules/apis (commits don't follow merge-base)
Auto-merging submodules/apis
CONFLICT (submodule): Merge conflict in submodules/apis
  • 冲突文件
    vscode显示为submodule 下 xxx.diff 文件,其内容为:
diff --cc submodules/apis
index a7b3a24f12,34fc93069c..0000000000
--- a/submodules/apis
+++ b/submodules/apis

使用git diff --submodule=diff 在命令行中输出的也是同样内容。

解决

git add submodulename
git commit

参考

https://stackoverflow.com/a/57732716

posted @ 2021-12-22 14:06  略略略——  阅读(3846)  评论(1编辑  收藏  举报