Global git ignore files

8 Oct
2009

Diclaimer: I shamelessly copied this article from freshsauce.

Here’s how to set-up globally a set of excludes when using GIT, in this case setting up GIT to ignore .DS_Store files on a Mac.

First add a common ignore file to the GIT configuration, in this case stored in the users home directory called .gitignore

NOTE: you’ll need to use the Terminal application found in the Utilities directory of the Applications folder on your Mac to run these commands.

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

Next add the exclude line for .DS_Store to the .gitignore file either with your favourite editor or simply with this command which will create it if it doesn’t already exist as well.

echo .DS_Store >> ~/.gitignore

Your done!

Related posts:

  1. Backup Server with rsnapshot
  2. git and cvs turnaround ‘guerilla style’
  3. Managing your dot files with git

2 Responses to Global git ignore files

Avatar

Dominik

October 9th, 2009 at 10:41 am

echo .DS_Store >> ~/.gitignore sollte wohl echo .DS_Store >> ~/.gitignore
sein

Avatar

Jon Kinney

March 12th, 2010 at 1:37 am

Thanks for the tip, I knew it was possible, just forgot exactly how to do it!

Comment Form

top

Switch to our mobile site