Mercurial hgignore 不会忽略目录
以前曾问过同样的问题,但解决方案对我不起作用。
我想通过将名为 .metadata 的文件夹添加到 .hgignore 文件来指示 Mercurial 忽略该文件夹。这是我的 .hgignore 文件:
glob:.hgignore
glob:.hgignore~
glob:.metadata/*
我已成功测试忽略 .hgignore 和 .hgignore~ 是否有效。如果我删除前两行并运行 hg status,它们就会出现。如果我包含前两行并运行 hg status,它们就会消失。但它不适用于 .metadata 文件夹。上面的语法是下面引用的解决方案中报告的语法。这对我不起作用。我也尝试过 glob:.metadata/ 。
临时解决方法是不在 .metadata 文件所在的工作区上使用 Mercurial。 ;-)
欢迎任何建议,谢谢!
编辑:解决方案所以看来这是可行的:
glob:.metadata
它也更简单,因此更漂亮。感谢 grut 指出这一点。
The same question has been asked before but the solutions don't work for me.
I want to instruct Mercurial to ignore a folder named .metadata, by adding it to the .hgignore file. Here is my .hgignore file:
glob:.hgignore
glob:.hgignore~
glob:.metadata/*
I have successfully tested that ignoring .hgignore and .hgignore~ works. If I remove the first two lines and run hg status, they show up. If I include the first two lines and run hg status, they disappear. But it doesn't work for the .metadata folder. The syntax above is the one reported in the solution referenced below. It doesn't work for me. I also tried glob:.metadata/.
A temporary workaround is not to use Mercurial on the workspace, where the .metadata files are. ;-)
Any suggestions welcome, thanks!
EDIT: SOLUTION And so it appears that this works:
glob:.metadata
it's also simpler and therefore prettier. Thanks to greut for pointing it out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的心里有这个:
I've got this in mine: