为什么.hgignore出现在我的补丁中?

时间:2013-06-23 12:58:12

标签: mercurial hgignore mercurial-queue

我使用Mercurial Queues来处理补丁。

最初没有.hgignore。 我不确定我是先创建MQ补丁,然后创建我的.hgignore或反过来。

(通过“创建补丁”我的意思是hg qnew patch_name -m "..."

无论如何,在我创建.hgignore补丁后,我对MQ进行了一些更改

当我hg qrefresh; hg export qtip时,我的补丁中也更改了.hgignore的内容。 因此,尝试向.hgignore本身添加.hgignore条目。但那没用。这些变化仍然存在。

所以,我试过hg forget .hgignore,这造成了更大的混乱。它显示我在我的补丁中删除了.hgignore。像这样:

--- a/.hgignore
+++ /dev/null
- all 
- the lines of .hgignore
- the lines of .hgignore

如何解决此问题? 我只希望.hgignore成为我本地仓库的一部分,并帮助不跟踪某些文件。

1 个答案:

答案 0 :(得分:2)

.hgignore旨在由Mercurial(doc)跟踪。忽略本地克隆中文件的标准方法是使用ui.ignore设置:

# .hg/hgrc
[ui]
ignore = /path/to/repo/.hg/hgignore

如果你有多个本地忽略文件,那么你可以写

[ui]
ignore.first = /path/to/repo/.hg/firstignore
ignore.second = /path/to/repo/.hg/secondignore

可以通过以下方式配置其他全局忽略文件:

[ui]
ignore.first = /path/to/repo/.hg/firstignore
ignore.second = /path/to/repo/.hg/secondignore
ignore.third = ~/thirdignore

所有设置都位于hgrc文件中。更多细节在这里: