我正在使用 git。
我已经完成了pull
Action 。并且存在 merge 冲突。
我想将一个特定文件返回到 merge 前的版本。
我该怎么做?
完成此操作后,我只想 pull 此文件。
会有 merge 冲突。我如何:
a) 将远程版本作为冲突解决方案?
b) 以本地版本作为冲突解决?
最佳答案
你可以保留你想要的版本:
git checkout --ours -- afile
git checkout --theirs -- afile
参见 gitready 文章“keep either file in merge conflicts ”。
确保阅读“Why is the meaning of “ours” and “theirs” reversed with git rebase
”,因为如果在 git rebase 期间发生 merge 冲突...
那么保留本地版本将是 git checkout --theirs -- afile
(!).
关于java - 如何使用git中止特定文件的 merge ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18054752/