git提交超过文件限制的解决办法
git提交超过文件限制的解决办法问题remote: error: See http://git.io/iEPt8g for more information.remote: error: File new-nsita/bitmap/bitmap.pdf is 189.85 MB; this exceeds GitHub's file size limit of 100.00 MBremote: e
·
git提交超过文件限制的解决办法
问题
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File new-nsita/bitmap/bitmap.pdf is 189.85 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
To https://github.com/wanqqq29/Daily-HTML.git
! [remote rejected] xxx -> xxx (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/wanqqq29/Daily-HTML.git'
报错信息中第三行提示文件太大
解决方法
- 查看是哪个文件超过限制
- 第二行
remote: error: File new-nsita/bitmap/bitmap.pdf is 189.85 MB; this exceeds GitHub's file size limit of 100.00 MB
说明是bitmap.pdf
这个文件太大,超过了100M的限制。所以我们就要处理这个文件了
- 第二行
- 重写commit,删除大文件
git filter-branch --force --index-filter 'git rm -rf --cached --ignore-unmatch new-nsita/bitmap/bitmap.pdf' --prune-empty --tag-name-filter cat -- --all
注意将new-nsita/bitmap/bitmap.pdf
替换成你的路径与文件
看到第8行提示重写 说明成功WARNING: git-filter-branch has a glut of gotchas generating mangled history rewrites. Hit Ctrl-C before proceeding to abort, then use an alternative filtering tool such as 'git filter-repo' (https://github.com/newren/git-filter-repo/) instead. See the filter-branch manual page for more details; to squelch this warning, set FILTER_BRANCH_SQUELCH_WARNING=1. Proceeding with filter-branch... Rewrite 2621a6906cd6cf828ccf659622c8959c98e6eaab (3/5) (1 seconds passed, remaining 0 predicted) rm 'new-nsita/bitmap/bitmap.pdf' WARNING: Ref 'refs/heads/master' is unchanged Ref 'refs/heads/xxx' was rewritten WARNING: Ref 'refs/remotes/origin/master' is unchanged WARNING: Ref 'refs/stash' is unchanged
不要忘了检查本地大文件还在不 - 强制推送修改后的repo
git push origin xxx --force
xxx是你当前的分支名- 可以看到成功推送
更多推荐
已为社区贡献1条内容
所有评论(0)