Skip to content

Instantly share code, notes, and snippets.

@RyadPasha
Created October 28, 2021 06:19
Show Gist options
  • Save RyadPasha/a9b86e09a8bacba0c4d20033ae8675d8 to your computer and use it in GitHub Desktop.
Save RyadPasha/a9b86e09a8bacba0c4d20033ae8675d8 to your computer and use it in GitHub Desktop.
How to remove .DS_Store file from GitHub that macOS creates
# remove .DS_Store file from GitHub that macOS 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 '.DS_Store removed'
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment