I am trying to push my .git
to Github.
git push origin master
[...]
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: fc1cc7aed3765ca1e847dee4b7fc831f
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File .terraform/plugins/darwin_amd64/terraform-provider-aws_v1.41.0_x4 is 107.37 MB; this exceeds GitHub's file size limit of 100.00 MB
To [example].git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@[example.git].git'
Which tells me that
.terraform/plugins/darwin_amd64/terraform-provider-aws_v1.41.0_x4
Is too big.
Fair enough:
rm -rf .terraform/
git rm -rf .terraform/
git rm -rf --cached .terraform/
Which gives
git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
deleted: .terraform/plugins/darwin_amd64/lock.json
deleted: .terraform/plugins/darwin_amd64/terraform-provider-aws_v1.41.0_x4
So, seems to be okay.
However, when pushing one more time (after commit), I got the exact same issue I have at the very beginning.
Except this time I have no more .terraform
, neither in my .git
nor in my local folder.
What is causing the issue, and how should I solve it?
I suspect there is some git history to be re-written, but not sure about that. Appreciate any help!
EDIT
No, the other SO answers did not help with my case.
Please see the answer I gave below.