DEV Community

Wilbur Suero
Wilbur Suero

Posted on

2 2

Correctly ignoring .DS_Store files

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.

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay