Git 提示 write error: Broken pipe
自从之前给 Git 设置好代理之后,我就确认了代理和代理设置没有任何问题。但是某天突然给我报错
Enumerating objects: 23, done.
Counting objects: 100% (23/23), done.
Delta compression using up to 12 threads
send-pack: unexpected disconnect while reading sideband packet
Connection to github.com closed by remote host.
Compressing objects: 100% (22/22), done.
fatal: sha1 file '<stdout>' write error: Broken pipe
fatal: the remote end hung up unexpectedly
我第一反应肯定是认为代理又出现问题了,但是我之前没有问题,不可能突然出现问题,我查询了很久,突然想到 Git 使用的是 SSH 协议。那么一般的 SSH 在长时间不活跃之后也会被默认关闭,所以我根据这条线索查询了以下该如何保持 SSH 的长连接
1、保持长连接
-
找到
.ssh目录,如果你安装的时候没有更改,那么目录可能是在C:\Users\admin\.ssh -
编辑目录下的
config文件,如果文件不存在,则新建一个.txt文件,并将文件名和后缀删掉改成config -
添加以下内容
Host * ServerAliveInterval 120