如何将点目录添加到购物车hgignore [英] how to add a dot-directory to mercurials hgignore
问题描述
我已经使用Mercurial已有一段时间了,使用hgignore从未遇到任何问题.
现在,我使用eclipse创建了一个新项目,该项目添加了.metadata
目录.
我似乎无法忽略.metadata
.
I have used mercurial for some time now and never had any problems using hgignore.
Now I have created a new project using eclipse, which added a .metadata
directory.
I seem to be unable to ignore the .metadata
.
nils@yavin $ hg status
? .metadata/.mylyn/repositories.xml.zip
? .metadata/.plugins/org.eclipse.core.resources/.history/37/509db4063df7001f14dbbfe704ff2c4e
...
我的.hgignore
看起来像这样:
syntax: regexp
/\.metadata/.*
\.metadata/.*
glob:.metadata/*
glob:.metadata/.mylyn/repositories.xml.zip
如您所见,我尝试了一些操作...我什至尝试直接添加一个文件,但是没有用.
处理点目录时涉及任何魔术吗?还是我今天只是愚蠢?
As you can see, I tried some things... I even tried adding one file directly, but it did not work.
Is there any magic involved when dealing with dot-directories? Or am I simply stupid today?
推荐答案
只需删除所有内容并离开:
Just remove everything and leave:
glob:.metadata/*
.hgignore中的第一行syntax:regexp
使hg将所有后续行都视为正则表达式,包括带有glob:.metadata/*
The first line syntax:regexp
in your .hgignore is making hg treat all subsequent lines as regex, including the one with glob:.metadata/*
这篇关于如何将点目录添加到购物车hgignore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!