我忘了.gitignore
我的Pods/
目录,我不小心检查并提交了一个大于100MB的文件,所以我不能推送到github。即使在与pod update
一起移除pod之后,手动删除导致问题的目录,并运行git rm --cached -r Pods/
从提交中删除所有Pod,每次我尝试推送时仍然会给出相同的错误:
remote: error: File Pods/GoogleMobileVision/TextDetector/Frameworks/TextDetector.framework/TextDetector is 267.62 MB; this exceeds GitHub's file size limit of 100.00 MB
我该如何解决?
您有一个或多个包含大文件的现有提交。
当您运行git push
时,您不会将文件发送到GitHub。你发送提交。
如果你删除了巨大的文件并再次提交,你现在至少有两个新的GitHub提交:一个拥有巨大的文件,后面是第二个没有它们。你想要的是更少和/或不同的提交,其中没有一个包含巨大的文件。
有关清理后的更多信息,请参阅Can't push to GitHub because of large file which I already deleted。
首先,删除Pods
目录并提交:
rm -rf Pods
git add .
git commit -m "Remove Pods/ directory"
然后将Pods/
添加到您的.gitignore
并提交:
git add .
git commit -m "Add Pods/ directory to .gitignore"
现在你应该能够运行pod install
/ pod update
并毫无问题地推送到GitHub。