Global hgignore usage

旧街凉风 提交于 2019-12-22 01:25:22

问题


In my mercurial.ini file, I call a global hgignore file like this:

[ui]
ignore = ~/hgignore.ini

This refers to a hgignore.ini file which is in the same directory as the mercurial.ini file.

  1. Does the local hgignore override the global hgignore?
  2. If so, is it recommended to have a single global hgignore with relevant sections marked or have a global hgignore file for general patterns and individual local hgignore files for special patterns pertaining to the particular repo?

By global hgignore with relevant sections marked, I mean:

syntax: glob

# VISUAL STUDIO

*.obj
*.pdb
*.suo
[Bb]in
[Dd]ebug*/
[Rr]elease*/

# TEMPORARY FILES

*.log
*.bak
*.cache    

回答1:


The global .hgignore is "added" to the local one. This means that everything in the global one will be considered for each repository, but the content of the local one will also be considered.

For the second question, I think the best answer is : it depends on what you want ;)

  1. If you want a really fine grained control on what is ignored for each repository, go for the local version.
  2. If you want to don't be bothered each time you create a repo, add everything to the global file.
  3. Anything in between to suits your needs...

In my case, I use both of them. The global .hgignore contains project files (Visual Studio, Netbeans), backup files (.bak, vim), libraries (dll, so, etc). And for each project, I put whatever is specific in the local file.



来源:https://stackoverflow.com/questions/8300470/global-hgignore-usage

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