how to add a dot-directory to mercurials hgignore

送分小仙女□ 提交于 2019-12-08 02:03:52

问题


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
...

My .hgignore looks like this:

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?


回答1:


Just remove everything and leave:

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/*



来源:https://stackoverflow.com/questions/4288093/how-to-add-a-dot-directory-to-mercurials-hgignore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!