Search code examples
gitgitlabblobnode-modulescommit

Git blob too large when committing to Gitlab


I am running a ReactJS website using webpack and ran a build to push to my production server. However, node_modules was being pushed even through my .gitignore. I cleared the cash, committed and now node_modules is not being added to git (good). However, when I try to commit some new code changes, I get the following error from gitlab: enter image description here

I've ran git ls-tree -r HEAD | grep $BLOB_ID and am able to see the file. I'm not really sure how to remove that so that I can commit to gitlab. There are times when I see that same error and run the above command and no path is listed. I've spent a lot of time with this and really have no clue how to resolve this going forward so I can push to my repos. Any help is appreciated, thanks.


Solution

  • If your intention is to remove the offending file BFG repo cleaner then replace the remote repository history (BE CAREFULLY) with the clean local repository.