解决冲突:如何接受“他们的"自动更改? [英] Resolving conflicts: how to accept "their" changes automatically?
问题描述
使用hg merge
合并冲突的更改时,Mercurial会在文件中插入一组标记,以将其合并到我的工作副本中,如下所示:
When merging conflicting changes using hg merge
, Mercurial inserts a set of markers into the files to be merged in my working copy like this:
<<<<<<< local
version = 0.2
=======
version = 0.1
>>>>>>> other
然后,我从hg resolve --all -l
生成的列表中手动编辑所有标记为U的文件,然后告诉Mercurial我已通过hg resolve -m file1 file2 file3 ...
Then I manually edit all files marked as U from a list produced by hg resolve --all -l
and then I tell mercurial I have resolved them by hg resolve -m file1 file2 file3 ...
在许多情况下,我希望在一些冲突的文件上接受我自己的更改或他们自己的更改.我正在考虑创建两个简单的sed/awk/任何名为accept-theirs.sh
和accept-my.sh
的脚本,或者是否有任何适当"的方式来做到这一点?
In many situations I would like however accept either my-only or their-only changes on some conflicting files. I am thinking to create two simple sed/awk/whatever scripts named accept-theirs.sh
and accept-my.sh
or is there any "proper" way to do it?
推荐答案
使用
hg resolve -t internal:other --all
接受theirs
和
hg resolve -t internal:local --all
接受yours
这篇关于解决冲突:如何接受“他们的"自动更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!