28 Aug 2019

Git: Fix push failure due to large files


Github Enterprise does not allow large files to be pushed to the repositories. As a result, any push committed with a large file will fail. If you redo the push, the git client will throw error, even after deleting the large file. This is because the large file will exist in the git history. The git history should be modified in order for the push to go through.

This is done using the git filter-branch command.

git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch ' HEAD

There is another awesome faster tool to do the same: