1

I added a big folder (.terraform) with git add ., and then committed.

Then I realized that's not a good idea. Edited .gitignore. Committed.

Then realized that when pushing to origin, it was still pushing big files. Looked around and found this: Git still adds and tracks folders marked in .gitignore

So did git rm -r --cached . , added back in everything.

My index seems to be clean. But when I do git push origin branch, it seems to want to upload all the big files still, as it takes a lot of time, and finally finishes with

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 4949224cd016eea505329480a9359f56
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File scripts/terraform/testing/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.62.0_x4 is 146.95 MB; this exceeds GitHub's file size limit of 100.00 MB

How do I clean up this so that pushing doesn't push the big files which I want ignored anyways?

.gitignore looks like this:

1 **/.terraform/*

phd
  • 82,685
  • 13
  • 120
  • 165
transient_loop
  • 5,984
  • 15
  • 58
  • 117
  • Thanks @mx0 but the link suggests exactly the same as the link I posted in my Q, which I did, but still I am getting the same error as above – transient_loop May 22 '20 at 14:39
  • If you only have 2 new commits (big one and gitignore) the do `git reset @~2` and add everything except big folder again. – mx0 May 22 '20 at 15:25

0 Answers0