Mercurial - 用户特定的忽略文件
我试图让 Mercurial 忽略特定用户的隐藏文件。我使用了这里的说明:
并让它忽略特定存储库中的文件。我想将此行为扩展到特定用户的所有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要指定 ~/.hgignore。它会在系统 hgignore 之后和 repo hgignore 之前自动应用。
我在
~/.hgrc
中使用了许多忽略文件,在 Linux 上使用 hg 1.5 没有问题。创建一个简单的存储库,其中包含一些您想要忽略的文件,设置您的忽略条目,然后执行
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.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 notI
, then you have a serious problem in your hg/linux setup.