如何从我的 Xcode 存储库中删除 DerivedData 文件夹,以及如何永久阻止它包含在提交中?
Xcode 3 没有这个问题。从 Xcode 4.1 开始。
解决方案
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch DerivedData/'
(对于文件夹)
git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename_here'
(对于文件)
最佳答案
如果您想从以前的历史记录中删除该文件夹,您可以关注 Github's删除敏感数据的指南。
如果你只想从这里删除它,你可以使用
git rm -r --cached folderName/
然后,将以下行添加到根目录中名为 .gitignore
的文件
文件夹名称
关于git - Xcode 不断提交 DerivedData 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6950897/