在MacOS上的Visual Studio项目中,不断变化的.DS_Store文件是什么?

时间:2019-02-16 13:23:06

标签: visual-studio xamarin github

我注意到,当我对应用程序进行小的更改时,一个名为<solution>/.DS_Store的文件被修改,除其他文件外,我还被提示推送该文件的新版本。这是否需要?如果不是,那么应该是.gitignore文件中的文件吗?如何在其中添加文件?

1 个答案:

答案 0 :(得分:4)

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

  

Apple macOS操作系统中, .DS_Store 是一个文件,用于存储包含folder的自定义属性,例如{{ 3}}或选择背景图片。该名称是 Desktop Services Store 的缩写,反映了其用途。它由icons应用程序在每个文件夹中创建和维护,其功能类似于Finder中的文件desktop.ini。以句号(句点)开头,在Finder和许多Unix实用程序中为Microsoft Windows。其内部结构为hidden

几乎可以肯定,版本控制系统应该忽略它。添加

.DS_Store

转到项目的.gitignore文件,然后通过运行取消跟踪文件

git rm --cached .DS_Store

并提交更改。