git clone: TCP connection reset by peer

失败报错:

[lj@localhost scripts]$ git clone https://github.com/hyperledger/fabric-samples.git
正克隆到 'fabric-samples'...

fatal: unable to access 'https://github.com/hyperledger/fabric-samples.git/': TCP connection reset by peer

失败截图:
在这里插入图片描述
解决办法

1.将https改成git

git clone git://XXXX

2.如果上述方法不管用,那么在原下载语句后加上--depth 1后缀

git clone https://XXXX --depth 1

方法二结果如下,成功:

[lj@localhost scripts]$ git clone https://github.com/hyperledger/fabric-samples.git --depth 1
正克隆到 'fabric-samples'...
remote: Enumerating objects: 1199, done.
remote: Counting objects: 100% (1199/1199), done.
remote: Compressing objects: 100% (837/837), done.
remote: Total 1199 (delta 294), reused 780 (delta 160), pack-reused 0
接收对象中: 100% (1199/1199), 1.52 MiB | 2.43 MiB/s, done.
处理 delta 中: 100% (294/294), done.

猜你喜欢

转载自blog.csdn.net/qq_40713201/article/details/125018602