.DS_store ( Desktop Services Store) 文件是什么?

禁用或启用自动生成禁止.DS_store生成:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

恢复.DS_store生成:恢复.DS_store生成:

defaults delete com.apple.desktopservices DSDontWriteNetworkStores

.DS_Store(英文全称 Desktop Services Store)是一种由苹果公司的Mac OS X操作系统所创造的隐藏文件,目的在于存贮目录的自定义属性,例如文件们的图标位置或者是背景色的选择。相当于 Windows 下的 desktop.ini。

删除 .DS_Store

如果你的项目中还没有自动生成的 .DS_Store 文件,那么直接将 .DS_Store 加入到 .gitignore 文件就可以了。

如果你的项目中已经存在 .DS_Store 文件,那就需要先从项目中将其删除,再将它加入到 .gitignore。

删除 .DS_Store
如果你的项目中还没有自动生成的 .DS_Store 文件,那么直接将 .DS_Store 加入到 .gitignore 文件就可以了。如果你的项目中已经存在 .DS_Store 文件,那就需要先从项目中将其删除,再将它加入到 .gitignore。如下:
删除项目中的所有.DS_Store。这会跳过不在项目中的 .DS_Store

$ find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

rm 'bundle/src/main/.DS_Store'
rm 'bundle/src/main/resources/.DS_Store'
rm 'bundle/src/main/resources/META-INF/.DS_Store'
rm 'quotareport/src/main/kotlin/com/alibaba/alibrain/quotareport/.DS_Store'

将 .DS_Store 加入到 .gitignore

echo .DS_Store >> ~/.gitignore

更新项目

git add --all
git commit -m '.DS_Store banished!'

如果你只需要删除磁盘上的 .DS_Store,可以使用下面的命令来删除当前目录及其子目录下的所有.DS_Store 文件:

find . -name '*.DS_Store' -type f -delete

Kotlin 开发者社区

国内第一Kotlin 开发者社区公众号,主要分享、交流 Kotlin 编程语言、Spring Boot、Android、React.js/Node.js、函数式编程、编程思想等相关主题。

1233356-bca93e5c34975635
Kotlin 开发者社区
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI天才研究院

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值