Open Source ProjectsCode that Might be Useful to You

Talks I've GivenOn Technologies and Ideas

ThoughtsWhere I Sometimes Write Things

Resume If You Believe In Those

Follow Me On

GitHubIf coding is your thing

TwitterIf you tweet

Configure git to globally ignore some files

If you think about it, there are always going to be some files you don’t care about keeping under version control. Immediately come to my mind are:

  • .DS_Store
  • vim swap files

Why should you always add these to your project’s .gitignore? The answer is, you shouldn’t, and you don’t need to.

Try this. Toss the following in ~/.gitignore:


Now run this:

$  git config --global core.excludesfile ~/.gitignore

Good job! Now .DS_Store and vim swap files will always be ignored.

Found this gem in the PeepCode Google Group.

comments powered by Disqus