Mercurial: Globally Ignore Files

泄露秘密 提交于 2019-11-28 16:25:11

问题


I know about .hgignore and how I can ignore files on a project-by-project basis. I want to ignore stuff for all Mercurial repositories.

Is there something I can stick in .hgrc? Or put a .hgignore in my $HOME path (I tried that already but maybe I did something wrong).


回答1:


You can add a path to a global or per-user ignore file in the [ui] section of your global/user hgrc or Mercurial.ini:

[ui]
ignore = ~/.hgignore

On Windows:

[ui]
ignore = %USERPROFILE%\.hgignore



回答2:


In powershell, you can get to your global files like this.

PS> notepad $env:userprofile/mercurial.ini
...
[ui]
ignore = %USERPROFILE%\.hgignore
...

PS> notepad $env:userprofile/.hgignore
/bin/
/obj/


来源:https://stackoverflow.com/questions/6644174/mercurial-globally-ignore-files

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