解决子模块的合并冲突


问题

  • 试图合并
    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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM