5

删除 Git 仓库中已经存在的 .DS_Store

 3 years ago
source link: http://i.lckiss.com/?p=7226
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

删除 Git 仓库中已经存在的 .DS_Store

2021-07-19

这个问题我考虑很久了,只是一直没去做,然后周末检索了下,发现一个简单的办法,直接在项目目录执行以下命令:

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

然后将这个讨厌的 .DS_Store 添加到排除文件中:

echo */.DS_Store >> ~/.gitignore

接着 commit 提交即可:

git commit -m '.DS_Store remove.'

  • 2021051300031389.jpg

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK