在Mercurial中合并时排除文件 [英] Excluding a file while merging in Mercurial

查看:43
本文介绍了在Mercurial中合并时排除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Mercurial与TortoiseHg一起使用.我有两个分支(AB),其中有两个文件(toto.cstiti.cs).

I use Mercurial with TortoiseHg. I have two branches (A and B) with two files (toto.cs and titi.cs).

当我想将BA合并时,是否有办法将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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆