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

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命令

参考:https://git-scm.com/book/zh/v1/Git-%E5%B7%A5%E5%85%B7-%E9%87%8D%E5%86%99%E5%8E%86%E5%8F%B2#%E6%A0%B8%E5%BC%B9%E7%BA%A7%E9%80%89%E9%A1%B9:-filter-branch

猜你喜欢

转载自www.cnblogs.com/samwu/p/9760023.html