0

I forgot to .gitignore my Pods/ directory, and I accidentally checked in and committed a file larger than 100MB so I can't push to github. Even after removing the pods all together with pod update, manually deleting the directory causing the issue, and running git rm --cached -r Pods/ to remove all Pods from the commit, it still gives me the same error every time I try to push:

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

How do I fix this?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Dylan Powers
  • 209
  • 4
  • 10

2 Answers2

1

You have one or more existing commits that contain the large file(s).

When you run git push, you don't send files to GitHub. You send commits.

If you have deleted the huge files and committed again, you now have at least two new commits for GitHub: one that has the huge files, followed by a second one that doesn't have them. What you want is to have is fewer and/or different commits, none of which have the huge files in them.

See Can't push to GitHub because of large file which I already deleted for more about cleaning up after this.

torek
  • 448,244
  • 59
  • 642
  • 775
-1

First, remove the Pods directory and commit that:

rm -rf Pods
git add .
git commit -m "Remove Pods/ directory"

Then add Pods/ to your .gitignore and commit that:

git add .
git commit -m "Add Pods/ directory to .gitignore"

Now you should be able to run pod install/pod update and push to GitHub without any issues.

alanpaivaa
  • 1,959
  • 1
  • 14
  • 23
  • I'm still getting the same error even after doing that, is that because I had previously committed all of those Pods? – Dylan Powers Mar 04 '19 at 03:44