报错问题
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 - https://git-lfs.github.com.
remote: error: Trace: cd56401cea0e1e976a7eb6c551f09a61ccb0049647444277bc884b1ba8320e6e
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File xxx is 104.50 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/xxx.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/xxx.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_dir
git lfs install
git lfs track yourbigfile
git add yourbigfile
git commit -m "add bigfile"
git push origin master
问题,结果上传超时Orz
LFS: Put "https://github-cloud.s3.amazonaws.com/alambic/media/319041240/fb/60/fb60b1c58a22262b3184479833d3cc540ff8783f274b73492d5d?actor_id=11&key_id=22&repo_id=33": dial tcp 54.231.34.41:443: i/o timeout
参考文件
- https://docs.github.com/en/free-pro-team@latest/github/managing-large-files/distributing-large-binaries
- https://docs.github.com/en/free-pro-team@latest/github/managing-large-files/removing-files-from-a-repositorys-history
- https://github.com/git-lfs/git-lfs/issues/1581
- https://docs.github.com/en/free-pro-team@latest/github/managing-large-files/installing-git-large-file-storage