Mercurial hgignore 不会忽略目录

发布于 2024-12-27 06:31:50 字数 690 浏览 3 评论 0原文

以前曾问过同样的问题,但解决方案对我不起作用。

我想通过将名为 .metadata 的文件夹添加到 .hgignore 文件来指示 Mercurial 忽略该文件夹。这是我的 .hgignore 文件:

glob:.hgignore
glob:.hgignore~
glob:.metadata/*

我已成功测试忽略 .hgignore 和 .hgignore~ 是否有效。如果我删除前两行并运行 hg status,它们就会出现。如果我包含前两行并运行 hg status,它们就会消失。但它不适用于 .metadata 文件夹。上面的语法是下面引用的解决方案中报告的语法。这对我不起作用。我也尝试过 glob:.metadata/ 。

临时解决方法是不在 .metadata 文件所在的工作区上使用 Mercurial。 ;-)

欢迎任何建议,谢谢!

编辑:解决方案所以看来这是可行的:

glob:.metadata

它也更简单,因此更漂亮。感谢 grut 指出这一点。

如何将点目录添加到mercurials hgignore

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.

how to add a dot-directory to mercurials hgignore

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

献世佛 2025-01-03 06:31:50

我的心里有这个:

syntax: glob
.metadata

I've got this in mine:

syntax: glob
.metadata
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文