Skip to content

Instantly share code, notes, and snippets.

@aaronsummers
Last active October 1, 2020 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronsummers/8fafe01a92ce1a1a84f200d4bec2991f to your computer and use it in GitHub Desktop.
Save aaronsummers/8fafe01a92ce1a1a84f200d4bec2991f to your computer and use it in GitHub Desktop.
Remove .DS_Store from GIT repository

https://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository#answer-107921

Remove existing files from the repository:

cd /... into your repository, then...

find . -name .DS_Store -print0 | xargs -0 git rm -f --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). You can do this easily with this command in the top directory

echo .DS_Store >> .gitignore

Then

git add .gitignore
git commit -m '.DS_Store banished!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment