当团队中的其他人修改了某个文件时,当我从 GitHub pull 时,Git 命令显示存在 Git 无法修复的 Unresolved 冲突。我打开 Perforce 或 Visual Studio 2012 来修复冲突,图形工具显示没有冲突并快速执行 merge 。
Git 是否有独立于您设置的 mergetool/difftool 的内部冲突检测/merge 工具?
或者它是否使用您配置的工具来自动 merge 和检测无法解决的冲突?
我的情况很奇怪,Git 显示它无法自动 merge ,但图形工具没有显示任何问题。
最佳答案
Git 有一个独立于 difftool
的内部 merge 系统。无论如何,您可以使用手册中的 -s
选项指定 merge strategy
:
-s <strategy>
--strategy=<strategy>
Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried. If there is no -s option, a built-in list of strategies is used instead (git merge-recursive when merging a single head, git merge-octopus otherwise).
在 merge 大量树时,策略从简单的 FastForward
到 Octopus
。
检查这个answer查看不同的 merge
策略是如何工作的。
无论如何,你的场景很奇怪。也许您的 IDE 使用不同的 merge 策略,所以当它打开时,它会以正确的方式进行 merge 。
关于git - Git 如何决定冲突?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17656448/