如何修复 Git 中的“packet_write_wait: Connection to ... Broken pipe”错误

Eve*_*ust 7 git ssh github

我怎样才能解决这个问题,当我git push文件到我的远程存储库,它抛出错误“packet_write_wait:连接到13.250.177.223端口22:断的管”?之前git push,我不得不克隆从遥控器上的项目和git addgit commit成功。

我试过git pull,,git config http.postBuffer 52428800但它不起作用。

HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git pull
packet_write_wait: Connection to 52.74.223.119 port 22: Broken pipe
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git config http.postBuffer 52428800
HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git push -u origin master
Counting objects: 46, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (46/46), done.
packet_write_wait: Connection to 13.250.177.223 port 22: Broken pipe
Writing foabjecttals:   8:% The  (4/4remote end hung up u6nex)pectedly
fatal: sha1 file '<stdout>' write error: Broken pipe
fatal: The remote end hung up unexpectedly
HP@EverChan MINGW32 /d/ChromeDownload/jiaoben5049/meetingDemo (master)
$ git push -u origin master
packet_write_wait: Connection to 13.250.177.223 port 22: Broken pipe
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


Run Code Online (Sandbox Code Playgroud)

Tan*_*pta 11

在将我的 repo 推送到 github 的上下文中,对我有用的是将IPQoS=throughput添加到 ~/.ssh/config 中的配置文件中。确保 SSH 设置正确、添加到您的 Github 帐户等的其他步骤在此处详细说明


Von*_*onC 2

Make sure your SSH URL for your remote origin does work:

ssh -T yourServer
Run Code Online (Sandbox Code Playgroud)

Its IP address should not change.

See if the issue persists with the latest Git for Windows (PortableGit-2.20.1-64-bit.7z.exe), uncompress in C:\Git, and set a simplified PATH in a CMD session.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
Run Code Online (Sandbox Code Playgroud)

Note: you can see arror messages with packet_write() failing.
Before, we gave an extra error message unnecessarily, which has been corrected with Git 2.32 (Q2 2021).

See commit 332ec96 (15 Apr 2021) by Matheus Tavares (matheustavares).
(Merged by Junio C Hamano -- gitster -- in commit 279a2e6, 30 Apr 2021)

pkt-line:不报告两次数据包写入错误

签署人:马修斯·塔瓦雷斯

发生write()错误时,packet_write()会显示与被调用者已打印的相同错误消息packet_write_gently()
这会产生不必要的冗长和重复的输出:

error: packet write failed 
fatal: packet write failed: <strerror() message>  
Run Code Online (Sandbox Code Playgroud)

除此之外,packet_write_gently()并不总是满足调用者的期望,即在非零返回之前正确设置 errno。
特别是,“数据超出最大数据包大小”错误的情况并非如此。
因此,在这种情况下,packet_write()将调用die_errno()并打印一条strerror(errno)可能与实际错误完全无关的消息。

packet_write()通过将和转换为常见的较低级别函数的包装器来修复这两个问题packet_write_gently(),该函数不会打印错误消息,而是将其返回到缓冲区中以供调用者die()error()根据需要进行处理。