I encountered the following error when pushing the local repository to a remote repository.
error: File stage/services/webserver-cluster/.terraform/providers/registry.terraform.io/hashicorp/aws/4.39.0/linux_amd64/terraform-provider-aws_v4.39.0_x5 is 278.77 MB; this exceeds GitHub's file size limit of 100.00 MB
Below are the files in the webserver-cluster directory:
.gitignore
drwxr-xr-x 1 armzig armzig 4096 Nov 28 17:58 .terraform
-rw-r--r-- 1 armzig armzig 1377 Nov 28 17:58 .terraform.lock.hcl
-rw-rw-r-- 1 armzig armzig 3510 Nov 28 15:40 main.tf
-rw-rw-r-- 1 armzig armzig 254 Nov 28 15:05 outputs.tf
-rw-rw-r-- 1 armzig armzig 124 Nov 28 15:05 variables.tf
//.gitignore
.terraform/
*.tfstate
*.tfstate.*
terraform
**/.terraform/*
*.tfstate.backup
terraform.tfstate
terraform.tfstate.backup
How can I resolve this error?
Actions taken:
I removed the terraform directory from my working tree.
I used git ls-files to verify that the terraform directory does not exist in the index directory.
I run git filter-branch --index-filter 'git rm --cached --ignore-unmatch .terraform' on the top working directory.