What Is a .DS_STORE File?
You see .DS_Store files in your folders, ZIPs or Git repo. macOS created them. Here is what they do and how to get rid of them.
What a .DS_Store file is
.DS_Store (Desktop Services Store) is a hidden file macOS creates in every folder you open in Finder. It records view settings — icon positions, window size, sort order — for that folder.
Why you see it elsewhere
When you zip a folder, push to Git, or upload files from a Mac, the hidden .DS_Store tags along and shows up for Windows/Linux users, who have no use for it.
How to remove it
It is safe to delete — Finder just recreates it next time. To keep it out of a Git repo, add .DS_Store to .gitignore. To strip them from a tree: find . -name .DS_Store -delete.
Is it safe to delete?
Yes. You only lose that folder's Finder view preferences, which are cosmetic.
FAQ
Is it safe to delete .DS_Store?
Yes. macOS just recreates it; you only lose that folder's Finder view settings.
How do I stop .DS_Store in a Git repo?
Add a line .DS_Store to your .gitignore file.
How do I delete all .DS_Store files at once?
Run find . -name .DS_Store -delete from the top of the folder tree.