Git远程更新失败

时间:2016-04-26 09:49:51

标签: git vpn git-pull git-remote

我一直试图通过运气来传递这个错误。但经过100多次尝试后,仍未取得进展。

这里的背景很少,原点由私人服务器托管(需要VPN连接,平均速度<5Kbps)。尝试将本地与远程同步,文件差异超过60K +对象。所有git remote updategit pull的尝试都会返回此错误。

$ git remote update
Fetching origin
Enter passphrase for key '/c/Users/<user>/.ssh/id_rsa':
remote: Counting objects: 71130, done.
remote: Compressing objects: 100% (22707/22707), done.
packet_write_wait: Connection to <VPN IP>: Broken pipe KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
error: Could not fetch origin
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
error: failed to run reflog

注意:使用SourceTree的mintty(在Windows环境中运行)。

我甚至添加了一个全局git配置http.postbuffer=524288000 ,但仍然没有进展。我也尝试从不同的终端从更新的本地git进行复制,但得到一种奇怪的行为,要求我总是同步超过50K +对象。

任何评论或建议都非常被接受。

1 个答案:

答案 0 :(得分:0)

由于您正在进行非常慢的连接,因此必须增加超时

# Edit /etc/ssh/ssh_config Or ~/.ssh/config depending on your OS
# and set the connection timeout to long value
Host *
ServerAliveInterval 1200

# Also set the keep alive flag
TCPKeepAlive yes