全局hgignore用法 [英] Global hgignore usage

查看:132
本文介绍了全局hgignore用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的mercurial.ini文件中,我这样调用全局hgignore文件:

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

[ui]
ignore = ~/hgignore.ini

这是指hgignore.ini文件,该文件与mercurial.ini文件位于同一目录中.

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

  1. 本地hgignore是否会覆盖全局hgignore?
  2. 如果是这样,建议使用单个全局hgignore标记相关部分,还是使用全局hgignore文件存储常规模式,并使用单个本地hgignore文件存储特殊模式的特定仓库?

通过全局hgignore并标记了相关部分,我的意思是:

syntax: glob

# VISUAL STUDIO

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

# TEMPORARY FILES

*.log
*.bak
*.cache    

推荐答案

全局.hgignore被添加"到本地.这意味着将针对每个存储库考虑全局存储库中的所有内容,但还将考虑本地存储库中的内容.

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. 如果要对每个存储库忽略的内容进行非常细粒度的控制,请使用本地版本.
  2. 如果不想每次创建存储库时都被打扰,请将所有内容添加到全局文件中.
  3. 介于两者之间的任何东西都可以满足您的需求...

就我而言,我同时使用它们.全局.hgignore包含项目文件(Visual Studio,Netbeans),备份文件(.bak,vim),库(dll等).对于每个项目,我都会在本地文件中放入特定内容.

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.

这篇关于全局hgignore用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆