git 提示 fatal: The remote end hung up unexpectedly
我在 git push
的时候遇到报错 fatal: The remote end hung up unexpectedly
解决方法如下:
1. 调整缓存限制(大文件推送)
git config --global http.postBuffer 524288000 # 设置缓存为500MB
git config --global https.postBuffer 524288000 # 设置缓存为500MB
2. 优化网络传输设置
git config --global http.lowSpeedLimit 0 # 禁用最低传输速度限制
git config --global http.lowSpeedTime 999999 # 延长超时时间
题外话,对大文件进行管理的时候,千万不要忘记用Git LFS
使用Git LFS管理大文件
git lfs install # 安装Git LFS扩展
git lfs track "*.psd" # 跟踪指定类型的大文件
git add .gitattributes # 提交跟踪配置
git add file.psd && git commit -m "Add large file" # 常规提交