Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is .DS_Store file important?

Tags:

git

Is .DS_Store an important hidden files?, its giving me problems with pulling from github. It is suggesting I remove it and I did. Hope this won't bite me in the butt later on.

like image 822
Son Truong Avatar asked May 14 '15 20:05

Son Truong


People also ask

Can I delete .DS_Store files on Mac?

No data is lost by deleting the corrupted files as Mac Finder only creates . DS_Store files to store viewing options, such as the positions of icons, size of the Finder window, and window backgrounds. To delete a corrupted . DS_Store file, you will need to use Terminal.

Can I delete .DS_Store files on Windows?

Open Finder > Applications > Utilities > Terminal. E.g., To delete all DS_Store files on the desktop, enter cd desktop and press Enter. To delete all DS_Store files on other folders, type cd followed by a space, drag the folder icon to Terminal, and press Enter. Select OK.

What is a .DS_Store file on Mac?

In the Apple macOS operating system, . DS_Store is a file that stores custom attributes of its containing folder, such as folder view options, icon positions, and other visual information. The name is an abbreviation of Desktop Services Store, reflecting its purpose.

Should I push DS_Store to Git?

It's safest to place it into your . gitignore file and be done with it. If it's already in your repository, then you can use git rm --cached . DS_Store to remove it from your system after it's been entered into .


2 Answers

Just add it to .gitignore, the file has no relevance on other computers.

The .DS_Store file is used to store Finder information about that folder, so it's has no use in a git repo.

like image 69
Cristik Avatar answered Sep 20 '22 13:09

Cristik


.DS_Store is a Mac-specific hidden file. It's also not something that you generally want to add to source control, as its contents may change without you necessarily interacting with it.

It's safest to place it into your .gitignore file and be done with it. If it's already in your repository, then you can use git rm --cached .DS_Store to remove it from your system after it's been entered into .gitignore.

like image 37
Makoto Avatar answered Sep 21 '22 13:09

Makoto