How
In Mac OS, .DS_Store
is very annoying when you add files to a git repository. Following code can remove all .DS_Store
file in an existing git repo.
# Delete all .DS_Store in a project
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
# add .DS_Store to .gitignore
echo .DS_Store >> ~/.gitignore
# update project
git add --all
git commit -m 'rm .DS_Store'