Skip to main content

Working from the bases that .DS_Store has not been added to your git repository, then you can add it to your .gitignore file.

touch .gitignore

In the .gitignore file add the following

# Hide the DS_Store files
**/.DS_Store

However, if it's already there, then in Terminal you will need to write:

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

Finally commit to repo

git commit -m "Remove .DS_Store"
git push origin main