Skip to content

Instantly share code, notes, and snippets.

@Alicebond
Forked from vybstat/ds_store_removal
Last active August 23, 2021 21:24
Show Gist options
  • Save Alicebond/9aeb8482bb2945d4c57dccbfbb3b055c to your computer and use it in GitHub Desktop.
Save Alicebond/9aeb8482bb2945d4c57dccbfbb3b055c to your computer and use it in GitHub Desktop.
How to remove .DS_Store file from GitHub that Mac OS X creates
# remove .DS_Store file from GitHub that MAC OS X creates
# find and remove .DS_Store
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
# create .gitignore file, if needed
touch .gitignore
echo .DS_Store > .gitignore
# push changes to GitHub
git add .gitignore
git commit -m 'Remove .DS_Store'
git push origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment