Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
637 views
in Technique[技术] by (71.8m points)

github - Issues with pushing large files through Git

Currently when I try to push to a Git repo, I am getting the following error.

remote: error: GH001: Large files detected.
remote: error: Trace: 7bbfe5c1099cfe679aa3cd1eee13e10a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File e3384023be667de7529538b11c12ec68.201307290946.sql.gz is 125.37 MB; this exceeds GitHub's file size limit of 100 MB

I have gone through and made sure that this file does not exist in the directory, and have done git add -u. We have tried to prune the branch but this doesn't work as it can't find the file to delete.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It is possible that you are pushing several commits, one of them including a large file, and another more recent one removing that file.

In any case, you can try, as explained in "Fixing the “this exceeds GitHub’s file size limit of 100 MB” error", a filter-branch (if you know the name/path of the large file that you can't see)

git filter-branch --index-filter 'git rm --cached --ignore-unmatch e3384023be667de7529538b11c12ec68.201307290946.sql.gz' <sha1>..HEAD

Or, if you don't know but want to get rid of any large file (say > 90MB), you can use the BFG repo cleaner

bfg --strip-blobs-bigger-than 90M  my-repo.git

That will track for you that elusive large file in your repo history and remove it.
Note that you will have to do a git push --force after that, because the history of the more recent commits will have been modified.
If others already cloned your repo before, a bit of communication is in order to warn them.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...