Project Files

Written & tested for accuracy by a developer (not AI) · Updated November 2026

What Is a .DS_Store File?

A .DS_Store file is a hidden file that the Mac Finder uses to control how a folder looks. Here's an explanation. Learn if it is safe to delete and how to keep it out of Git.

A .DS_Store file is a small hidden file that the Mac Finder keeps in a folder. It stores settings for how the folder is shown. Most people never see it, but it becomes visible come in a terminal application, or in a Git project. Here's what it is and whether to delete it.

People who see a .DS_Store often assume it is junk, or even a virus, and ask for a way to delete them all or prevent them from getting made. Experienced Mac users leave the files alone and add one line in a Git ignore file to projects free of extraneous .DS_Store files.

What's in a Project Folder? explains the other files and folders you'll find beside a .DS_Store file in a project. Learning about project folders and files is part of Mac software development.

What a .DS_Store file does

The name stands for Desktop Services Store, according to Arno Gourdol, who led the Finder's technical work at Apple when it was rewritten for Mac OS X. According to Gourdol, Desktop Services was built to keep track of icon positions and folder settings.

According to Gourdol and to Howard Oakley, a long-time Mac technical writer at The Eclectic Light Company, it stores a folder's view settings, such as icon positions, the view style, and the window size. Oakley adds that Finder comments (the Comments field in a file's Get Info window) depend on it too. Apple has never documented the file's format.

You won't find one in every folder. The Finder only makes one in a folder after a change to its files.

Why you can't see .DS_Store in the Finder

The name starts with a dot, which hides it in the Finder. Unlike other hidden files, .DS_Store stays hidden even after you press Command + Shift + . (period) to show hidden files. In a folder with a .env or .gitignore file, those two appear, dimmed, but the .DS_Store file stays hidden. Show Hidden Files on Mac explains the shortcut and other hidden files.

To see it, use the ls -a command in a terminal application, which lists every file whose name starts with a dot. Open a terminal application, go to a folder with cd, and run:

$ ls -a

You'll see .DS_Store in the list if the folder has one.

Is it safe to delete .DS_Store?

You can safely delete a .DS_Store file. It holds the folder's view settings, not your documents, so deleting one loses only how the folder looks in the Finder and its Finder comments. On your own Mac there is no reason to delete them. You don't need a cleaning app or a script that searches your whole disk for them.

The .DS_Store files accompany folders you send by AirDrop. On a Windows PC or in Google Drive, you might see one in folder that came from a Mac and you can delete it.

Keep .DS_Store out of Git

Developers encounter .DS_Store files in Git. The git status command lists any .DS_Store in a project as a new file. It is harmless but clutters your project's history. An AI agent that commits your changes may add it by accident.

One line, .DS_Store, in a project's .gitignore file keeps it out of that project. The starter projects from the "Set Up Your Mac" apps already have that line. What Is a .gitignore File? explains the file.

You can configure Git to ignore .DS_Store for every project on your Mac. Git reads a global ignore file, ~/.config/git/ignore (the ~ stands for your home directory). Here's how to configure it.

First, make the configuration folders, if they don't exist yet:

$ mkdir -p ~/.config/git

Then add .DS_Store as a line at the end of the file. The >> adds the line, and creates the file if needed, without erasing anything already in it:

$ echo ".DS_Store" >> ~/.config/git/ignore

You can open the file in an editor to check it.

Run git status in a project. The .DS_Store file no longer appears.

If a .DS_Store was already committed, the ignore rule doesn't apply to it until you tell Git to stop tracking it. Run this command in a project repository to remove it from Git's records but leave the file in the folder:

$ git rm --cached .DS_Store

Then commit the change.

Stop .DS_Store on network drives

If you're an administrator for a group of Macs in a company or school, .DS_Store files are shared over a network and can slow down browsing network folders. You can speed up browsing network folders by stopping the Mac reading .DS_Store files on SMB shares (SMB is the file-sharing system Macs and Windows PCs use for network drives). The command is:

$ defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

Log out and log in again for the change to take effect. To turn it off, run the same command with -bool FALSE. The setting's name says "write", but Apple describes it as stopping the Mac reading the files.

Now you know what a .DS_Store file is, why you can leave it alone on your Mac, and how to keep it out of every Git project with one line.

Continue setting up your Mac

Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.