Have you ever tried to run git push and run into the issue with a file being to large?

I recently had the same problem and was trying everything I was finding on google search. Only thing was everything I tried was causing more issues with my git solutions than fixing the problem.

Even trying to use git push origin master –force wasn’t working due to I had a zip file that was my backup file of my current website.

remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 7d51855d4f834a9065a5af26e93ds668
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File backups/datedbackup.zip is 102.00 MB; this exceeds GitHub's file size

Now this was extremely annoying because I added to exclude the backups folder from any gits going forward but due to I’ve already tried to push an commit this issue continued. So, a found an extremely simple fix to this problem with using the filer-branch command as follows:

git filter-branch --tree-filter 'rm -rf path/to/your/file' HEAD
git push

Once you have ran the git push your git tree will have removed the file from your commit and will continue to work as planned going forward but make sure you have ignored that file or folder going forward in your .gitignore file to ensure this doesn’t happen again.

Categories: Blog


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *