admin 管理员组

文章数量: 1086949

git无法push大文件:this exceeds GitHub‘s file size limit of 100.00 MB

报错问题

remote: Resolving deltas: 100% (16/16), completed with 1 local object.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - .
remote: error: Trace: cd56401cea0e1e976a7eb6c551f09a61ccb0049647444277bc884b1ba8320e6e
remote: error: See  for more information.
remote: error: File xxx is 104.50 MB; this exceeds GitHub's file size limit of 100.00 MB
To .git! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to '.git'

使用git lfs

移除大文件的影响


# 以下执行完,应该能正常的push。确保之前执行的错误不会对后续产生影响
git rm --cached path_of_a_giant_file
git commit --amend
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch path_of_your_bigfile'
git push

mac 安装

brew install git-lfs

git lfs

cd your_git_dirgit lfs install
git lfs track  yourbigfile
git add yourbigfile
git commit -m "add bigfile"
git push origin master

问题,结果上传超时Orz

LFS: Put "=11&key_id=22&repo_id=33": dial tcp 54.231.34.41:443: i/o timeout

参考文件

  • @latest/github/managing-large-files/distributing-large-binaries
  • @latest/github/managing-large-files/removing-files-from-a-repositorys-history
  • @latest/github/managing-large-files/installing-git-large-file-storage

本文标签: git无法push大文件this exceeds GitHubs file size limit of 10000 MB