Remove .DS_Store from Git repository

Posted on Tuesday, 28 May 2019

Run this command to remove .DS_Store files from your repository

find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch

You can also run this command to add .DS_Store to your .gitignore

echo "**/.DS_Store" >> .gitignore

Source: How to get rid of .DS_Store files in git repositories