Git 錯誤:the remote end hung up unexpectedly

最近修改專案並新增許多 packages。加入 Git 清單後,Push 時出現以下錯誤:
TortoiseGit 顯示的錯誤與標題相同。

Enumerating objects: 490, done.
Counting objects: 100% (381/381), done.
Delta compression using up to 12 threads
Compressing objects: 100% (288/288), done.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
fatal: the remote end hung up unexpectedly
Writing objects: 100% (299/299), 7.85 MiB | 8.89 MiB/s, done.
Total 299 (delta 133), reused 16 (delta 1), pack-reused 0
fatal: the remote end hung up unexpectedly
Everything up-to-date

錯誤訊息說明
Enumerating objects, Counting objects, Compressing objects, Writing objectsGit 正在打包、壓縮並準備送出,這部分正常。
error: RPC failed; HTTP 400 curl 22Git client 使用 HTTP POST 傳送資料,但遠端 server 回傳 HTTP 400(Bad Request)。
fatal: the remote end hung up unexpectedlyServer 端中途斷線,可能與資料包大小、逾時或伺服器不接受格式有關。

其中一個處理方式是把提交緩衝區調整為 5GB;這項設定會套用到所有 Git 專案。

git config --global http.postBuffer 5242880000

參考資料

git 推送出现 “fatal: The remote end hung up unexpectedly” 解决方案 - DomAndBom - 博客园
git 推送出现 ‘fatal: The remote end hung up unexpectedly’ 解决方案
Author image
關於 Richard Zheng
About me 喜歡爬山,瑜伽,溜冰,喜歡新奇的事,最喜歡的還是寫程式帶來的成就感,對於資訊會不斷的出現新事物也能抱持好奇與熱忱。近期開始將學習的心得寫在Blog,發現思路更清晰也加深了記憶。 紙上得來終覺淺,絕知此事要躬行