DS_Store文件介紹
DS_Store 是給Finder用來存儲這個文件夾的顯示屬性的:比如文件圖標的擺放位置。刪除以後的副作用就是這些信息的失去。(當然,這點副作用其實不是太大).
刪除GIT中的.DS_Store
- 項目中還沒有 .DS_Store
直接將 .DS_Store 加入到 .gitignore 文件就可以了。
- 項目中已經存在 .DS_Store 文件
首先從項目中將其刪除,再將它加入到 .gitignore。如下:
1.刪除項目中的所有.DS_Store。這會跳過不在項目中的 .DS_Store
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
2.將 .DS_Store 加入到 .gitignore
vim .gitignore
.DS_Store
3.提交
git add .
git commit -m ‘.DS_Store banished!’
原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/223059.html