在 merge 冲突中,我试图解决所有有利于特定分支的 merge 冲突。
我正在尝试执行 git checkout --ours
,但出现以下错误:
fatal: '--ours/--theirs' cannot be used with switching branches
我怎样才能实现我想做的事情?
最佳答案
将 git checkout
与 --ours
或 --theirs
一起使用需要至少一个参数:文件的路径/要 checkout 的目录。
作为the manual说:
When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.
所以:
git checkout --ours <path(s)>
关于git: fatal: '--ours/--theirs' 不能与切换分支一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40903599/