删除GitHub中的任何.DS_Store

时间:2012-08-03 10:40:18

标签: file github gitignore

我在GitHub上有一个存储库:

https://github.com/ludovicriffault/feed-tastic

我无法删除每个文件夹和子文件夹中的 .DS_Store 文件。我在Stackoverflow中尝试过很多文件.gitignore和一些答案,但没有任何作用......

有什么想法解决这个问题吗?提前谢谢!

1 个答案:

答案 0 :(得分:5)

您需要克隆您的仓库,然后

find . -name ".DS_Store" -exec git rm --cached -f {} \;.
git commit -m "delete files"
git push

我们的想法是在本地保留“.DS_Store”,同时将其从git repo中删除 .gitignore仅在首次从索引中删除“.DS_Store”时才有效,因此“git rm --cached -f”(请参阅​​git rm)。

相关问题