Written by me@grafxflow
20 Sep, 2022
0
1,980
It's very annoying under macOS when creating a new repo we occasionally see the dreaded .DS_Store files appear. So here is how to remove those annoying Mac OS X .DS_Store files from a Git repository.
First remove the existing .DS_Store files from the repository:
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
Then add this line:
.DS_Store
to the file .gitignore, which can be found at the top level of your repository (or create the file if it isn't there already). You can do this easily with this command in the top directory:
echo .DS_Store >> .gitignore
Then commit the file to the repo:
git add .gitignore
All done.
23 Apr, 2018
22 Apr, 2020
03 May, 2017
I am a Full-stack Developer who also started delving into the world of UX/UI Design a few years back. I blog and tweet to hopefully share a little bit of knowledge that can help others around the web. Thanks for stopping by!
Follow11 Jul, 2023
21 Jun, 2023
Views: 166,671
Views: 40,510
Views: 37,339
Views: 33,805