I am getting this error when I try to push to git and I have no idea how to fix it.
Counting objects: 1239, done.
Delta compression using up to 4 threads.
Compre
To remove large files, GitHub suggests:
$ git rm --cached giant_file
# Stage our giant file for removal, but leave it on disk
git commit --amend -CHEAD
# Amend the previous commit with your change
# Simply making a new commit won't work, as you need
# to remove the file from the unpushed history as well
git push
# Push our rewritten, smaller commit
Or if you want more general information on how to work with large files on GitHub.
And next time add /log
in your .gitignore
To improve upon one of the reply above, you need
git filter-branch -f --tree-filter 'rm -f /path/to/file' HEAD --all
in order to remove your file even from the history. You need -f
to force rewriting any backup and --all
to remove file from all branches. More information here: Git docs
Your large file error won't go away by removing it from the git cache because it is still lurking in the commit history.