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_Store
, node_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文件需要花一些时间来配置并通过防止提交中的噪音和不需要的文件来保持回报。 花时间享受奖励!
mercurial