-
問題描述:
在.gitignore中,和sourceTree的忽略文件中都添加了.DS_Store。但是每次更改,都有新的待提交 -
原因:
雖然已經(jīng)忽略了.DS_Store。但是因?yàn)橹疤峤贿^,已經(jīng)被Git追蹤。所以忽略無效。
-
解決辦法:
1.打卡終端,切到項(xiàng)目路徑下,執(zhí)行命令,刪除git下的.DS_Store。
git rm --cached -r .DS_Store
2.填更新信息
git commit -m "Remove tracked .DS_Store files and ignore them"
3.推送到遠(yuǎn)程分支
git push