John Topley John Topley - 1 year ago 173
Git Question

How can I Remove .DS_Store files from a Git repository?

How can I remove those annoying Mac OS X

files from a Git repository?

Answer Source

Remove existing files from the repository:

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

Add the line


to the file .gitignore, which can be found at the top level of your repository (or created if it isn't there already). Then

git add .gitignore
git commit -m '.DS_Store banished!'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download