I’ve been working with git on and off for about a month now. I’m on a Mac and git always picks up changes to the .DS_Store files within directories. Also when working with XCode, it picks up changes to the user workspace files, etc.

There are a few ways to tell git to ignore these files and not keep them under version control…mainly:

putting a .gitignore file in a directory and listing filenames and/or filename patterns to ignore – this can be checked in just like any other file. The effect is that anyone that clones your directory also will ignore these files.

entering the filenames and/or filename patterns to the .git/info/exclude file in your local repo – only affects your local repo

running the command git config –global core.excludesfile ~/.gitignore_global (.gitignore_global is a file where you specify the ignore patterns) to globally ignore certain files (see the link above fore more details) – I haven’t tried this yet, but this seems great so that you don’t have to re-specify which files to ignore every time you work with a git repo

This entry was posted
on Friday, February 10th, 2012 at 1:53 am and is filed under Software.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.