Skip to content

Instantly share code, notes, and snippets.

@tru2dagame
Created August 4, 2014 03:51
Show Gist options
  • Save tru2dagame/ba78e3f12ad078b0cc45 to your computer and use it in GitHub Desktop.
Save tru2dagame/ba78e3f12ad078b0cc45 to your computer and use it in GitHub Desktop.
Remove .DS_Store Files From A Git Repository

Remove existing files from the repository:

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

Add the line

.DS_Store

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!'

Or specify a global exclusion list

git config --global core.excludesfile ~/.gitignore
echo .DS_Store >> ~/.gitignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment