简体   繁体   中英

What's the .DS_Store file that keeps changing in my Visual Studio project on macOS?

I notice when I make a small change to the application then a file called <solution>/.DS_Store is modified and I am prompted to push the new version of that in addition to other files. Is this needed and if not then should it be something that's in the .gitignore file and how can I add it there?

The .DS_Store file is related to macOS, not to Visual Studio :

In the Apple macOS operating system, .DS_Store is a file that stores custom attributes of its containing folder , such as the position of icons or the choice of a background image. The name is an abbreviation of Desktop Services Store , reflecting its purpose. It is created and maintained by the Finder application in every folder, and has functions similar to the file desktop.ini in Microsoft Windows . Starting with a full stop (period) character, it is hidden in Finder and many Unix utilities. Its internal structure is proprietary .

It should almost certainly be ignored by your version control system. Add

.DS_Store

to your project's .gitignore file and then untrack the file by running

git rm --cached .DS_Store

and commit the change.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM