在Mercurial中合并时排除文件 [英] Excluding a file while merging in Mercurial
问题描述
我将Mercurial与TortoiseHg一起使用.我有两个分支(A
和B
),其中有两个文件(toto.cs
和titi.cs
).
I use Mercurial with TortoiseHg. I have two branches (A
and B
) with two files (toto.cs
and titi.cs
).
当我想将B
与A
合并时,是否有办法将titi.cs
从合并中排除,而仅合并toto.cs
?如果可能的话,我该怎么办?
Is there a way, when I want to merge B
with A
, to exclude titi.cs
from merging, and only merge toto.cs
? If it's possible, how can I do that?
推荐答案
好的.不合并titi.cs实际上只是完全按照A或B(您的选择)中存在的方式使用titi.cs.您可以像这样手动进行操作:
Sure. Not merging titi.cs is really just using titi.cs exactly as it exists in A or in B (your choice). You could do that manually like this:
hg update A
hg merge B
hg revert --rev A titi.cs
(将A和B交换到另一个方向).
或者,您可以在合并工具配置中自动自动在您的.hgrc
中带有类似的内容.
(swap A and B to go the other direction).
Or you could do that automatically in your Merge Tool Confguration with something like this in your .hgrc
.
[merge-patterns]
titi.cs = internal:local
这告诉Mercurial对于与该模式匹配的文件始终使用这个不是那个".
Which tells Mercurial to always use "this one not that one" for files matching that pattern.
这篇关于在Mercurial中合并时排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!