Correctly ignoring .DS_Store files
Wilbur Suero

Wilbur Suero @travelingwilbur

About: Full-stack dev with expertise in software & advertising. Delivers top-quality projects. Always learning & exploring new tech. Animal advocate & music lover. Based in La Romana, DR.

Location:
La Romana, Dominican Republic
Joined:
Oct 22, 2017

Correctly ignoring .DS_Store files

Publish Date: Jun 5 '20
6 0

This is a simple trick, but I'm posting it here as reference.

When you do git status and find some .DS_Store files scattered through your app's folders there a simple line to add to your .gitignore to ignore them all for good:

**/.DS_store
Enter fullscreen mode Exit fullscreen mode

However, if the .DS_Store files are already there type:

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
Enter fullscreen mode Exit fullscreen mode

This will remove them from folders and subfolders. Then just commit and push to your repo.

git commit -m "remove .DS_Store files from everywhere"
git push
Enter fullscreen mode Exit fullscreen mode

And that's it.

Comments 0 total

    Add comment