解决git误commit大文件导致不能push问题

(编辑:jimmy 日期: 2024/7/3 浏览:2)

git push时终端报错:

error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
fatal: The remote end hung up unexpectedly

你已经把大文件写入本地.git历史中。
你需要把它从commit历史,以及.git库里移除掉。
可以使用git filter-branch --tree-filter 'rm -f 文件名' HEAD命令

解决git误commit大文件导致不能push问题

参考:https://git-scm.com/book/zh/v1/Git-工具-重写历史#核弹级选项:-filter-branch

总结