mercurial_Mercurial:全球.hgignore

mercurial

I've worked with git for several years and one of my favorite git posts is Create a Global .gitignore which details how you can create a global .gitignore file to ignore certain useless files (think .DS_Store, node_modules, etc.) so that you aren't always adding the same files to every repository's .gitignore file and don't get presented with a bunch of garbage when running git status.

我已经使用git多年了,我最喜欢的git帖子之一是Create a Global .gitignore ,其中详细介绍了如何创建一个全局.gitignore文件来忽略某些无用的文件(例如.DS_Storenode_modules等),以便您并不总是将相同的文件添加到每个存储库的.gitignore文件中,并且在运行git status时不会出现大量垃圾。

The team I've been shifted to at Mozilla uses Mercurial instead of git, so you can imagine I'm trying to shake off the git mindset so I can become a Mercurial master.  With that said, a trick like a global .gitignore is philosophy-independent and just a good help.  The first step is opening your profile's .hgrc file and adding the following under the [ui] section:

我转职到Mozilla的团队使用Mercurial而不是git,所以您可以想像我正在尝试摆脱git的思维方式,以便成为Mercurial的专家。 话虽如此,诸如全局.gitignore类的技巧是与哲学无关的,并且是一个很好的帮助。 第一步是打开个人资料的.hgrc文件,并在[ui]部分下添加以下内容:


[ui]
ignore = ~/.hgignore


The above points to the location of a global .hgignore file.  Now open your .hgignore file and add files and directories which you never want added to any repositories:

上面的内容指向全局.hgignore文件的位置。 现在,打开您的.hgignore文件,并将您不想添加的文件和目录添加到任何存储库中:


.DS_Store
.orig
node_modules/


Global .*ignore files take a moment to configure and keep paying back by preventing noise and unwanted files in commits.  Take the time and enjoy the rewards!

全局。* ignore文件需要花一些时间来配置并通过防止提交中的噪音和不需要的文件来保持回报。 花时间享受奖励!

翻译自: https://davidwalsh.name/mercurial-ignore-files

mercurial

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值