whatfileis.pro
Paste a filename and find out what it is, whether it is safe, and what opens it.

Remove .DS_Store Files from Git and Windows

A Mac keeps dropping hidden .DS_Store files that clutter your Git repo, ZIP uploads and Windows folders. Here is how to delete them all and stop them coming back.

Category
Safe to delete?
Opens with

Remove .DS_Store files everywhere

macOS drops a hidden .DS_Store into every folder Finder opens, and they ride along into your Git repos, ZIP uploads and Windows shares. They are safe to delete. Clean them out:

  • From a folder tree (Mac/Linux): find . -name .DS_Store -delete
  • Keep them out of Git: add a line .DS_Store to .gitignore; to drop ones already committed, run git rm --cached "*.DS_Store" then commit.
  • On Windows: they are harmless clutter — just delete them; enable View → Hidden items to see them.
  • Stop them on network shares: on the Mac run defaults write com.apple.desktopservices DSDontWriteNetworkStores true and log out/in.

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.

How to view a .DS_Store file by OS

macOS: .DS_Store is a hidden Finder metadata file (icon positions, view settings). You don't open it; show hidden files with ⌘⇧. in Finder to see it.

Windows / Linux: it appears when you copy Mac folders. It has no use off macOS — a text editor shows only binary metadata.

Common problems

.DS_Store files clutter shared drives and Git repos. Add .DS_Store to .gitignore and, on network shares, disable them with defaults write com.apple.desktopservices DSDontWriteNetworkStores true.

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.

How do I stop .DS_Store files being created?

On network shares, run the DSDontWriteNetworkStores defaults command; locally they are harmless and regenerate automatically.

Other file types explained