Mercurial - 用户特定的忽略文件

发布于 2024-09-09 15:59:18 字数 950 浏览 1 评论 0原文

我试图让 Mercurial 忽略特定用户的隐藏文件。我使用了这里的说明:

如何使 Mercurial 忽略所有隐藏文件?< /a>

并让它忽略特定存储库中的文件。我想将此行为扩展到特定用户的所有 hg 存储库。

hgrc 手册页 表示您可以链接用户特定的忽略文件(例如,〜/ .hgignore)通过在〜/ .hgrc中包含类似的内容:

[ui]
username = Some User <[email protected]>
ignore = ~/.hgignore

但这似乎不起作用。

我也尝试过,

ignore = /home/someuser/.hgignore
ignore = $HOME/.hgignore
ignore = ~/.hgignore2

但这似乎也不起作用。我错过了什么吗?我在 Mercurial 网站或其他地方找不到任何内容。请帮忙,谢谢。

**编辑-我在Linux上。 hg showconfig 表明 hg 正在正确读取我的 .hgrc 文件,但其中概述的忽略行为不起作用。

**编辑2 - 我还尝试重新启动我的机器,只是为了看看这是否会更新内容。但事实并非如此。

I am trying to get mercurial to ignore hidden files for a specific user. I used the directions here:

How to make mercurial ignore all hidden files?

and got it to ignore files in a specific repo. I want to extend this behavior to all hg repos for a specific user.

The hgrc man page says you can link a user specific ignore file (e.g., ~/.hgignore) by including something like this in your ~/.hgrc:

[ui]
username = Some User <[email protected]>
ignore = ~/.hgignore

but that doesn't seem to be working.

I have also tried

ignore = /home/someuser/.hgignore
ignore = $HOME/.hgignore
ignore = ~/.hgignore2

But that doesn't seem to be working either. Am I missing something? I can't find anything on the Mercurial site or anywhere else. Please help, thanks.

**EDIT - I am on Linux. hg showconfig indicates that hg is reading my .hgrc file correctly, the ignore behavior outlined therein is not working though.

**EDIT2 - I also tried restarting my machine, just to see if that would update things. It did not.

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

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

发布评论

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

评论(1

彡翼 2024-09-16 15:59:18

您不需要指定 ~/.hgignore。它会在系统 hgignore 之后和 repo hgignore 之前自动应用。

我在 ~/.hgrc 中使用了许多忽略文件,在 Linux 上使用 hg 1.5 没有问题。

[ui]
ignore = /home/geoffz/bin/hgext/hgignore
ignore.local = /home/geoffz/bin/hgext/hgignore.local
ignore.java = /home/geoffz/bin/hgext/hgignore.java

创建一个简单的存储库,其中包含一些您想要忽略的文件,设置您的忽略条目,然后执行 hg st -A。如果这些文件显示为 ? 而不是 I,那么您的 hg/linux 设置存在严重问题。

You don't need to specify ~/.hgignore. It is automatically applied after system hgignore and before repo hgignore.

I use many ignore files in ~/.hgrc without problem with hg 1.5 on linux.

[ui]
ignore = /home/geoffz/bin/hgext/hgignore
ignore.local = /home/geoffz/bin/hgext/hgignore.local
ignore.java = /home/geoffz/bin/hgext/hgignore.java

Create a trivial repo with a few files you want to ignore, setup your ignore entries, and do hg st -A. If those files are shown as ? and not I, then you have a serious problem in your hg/linux setup.

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