EDDYMENS

Last updated 2022-09-09 06:43:17

Prevent MacOS From Creating A .ds_store File

If you work on macOS, you might have noticed whenever you add image files or some media file to your project, a hidden file .DS_Store is created automatically.

This is how macOS stores metadata for media files. But you don't want this in your project.

There are two ways you can prevent this.

Preventing macOS from creating the .DS_Store file

You can run the following command in your terminal to prevent the creation of the file.

$ defaults write com.apple.desktopservices DSDontWriteNetworkStores true

NB: Be sure to restart your computer after running the command.

Ignoring the file in your project

Another approach you can take to prevent this file from being committed to your project is by excluding it from your versioning system.

To exclude this file in Git add the file name to your .gitignore file and commit it.

Here is another article you might like 😊 "Diary Of Insights: A Documentation Of My Discoveries"