Skip to content

Instantly share code, notes, and snippets.

@katagaki
Created July 23, 2025 22:25
Show Gist options
  • Save katagaki/68812f59ba94c1ac6df6dc13d34db54a to your computer and use it in GitHub Desktop.
Save katagaki/68812f59ba94c1ac6df6dc13d34db54a to your computer and use it in GitHub Desktop.
Remove .DS_Store from a new Git repository.
# From https://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
touch .gitignore
echo .DS_Store >> .gitignore
git add .gitignore
git commit --amend
git push -u origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment