git 致命:读取错误:对等方重置连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17977206/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
fatal: read error: Connection reset by peer
提问by Vijay13
Can some one help me to get rid of following:
有人可以帮助我摆脱以下问题吗:
vijay13@ubuntu:~$ git clone git://anongit.kde.org/plasma-mediacenter
Cloning into 'plasma-mediacenter'...
fatal: read error: Connection reset by peer
And
和
vijay13@ubuntu:~$ git clone [email protected]:plasma-mediacenter
Cloning into 'plasma-mediacenter'...
Read from socket failed: Connection reset by peer
fatal: The remote end hung up unexpectedly
How to get rid of both above issues?
如何摆脱上述两个问题?
回答by user846316
If internet connection is also fine, just run
如果互联网连接也很好,只需运行
git gc
and try again. It cleans up unnecessary files and optimize the local repository. For more details: git documentation
然后再试一次。它清理不必要的文件并优化本地存储库。更多细节:git文档
回答by Yavuz Sert
I also have faced with this problem.
我也遇到过这个问题。
The problem is solved when i replace "git://"with "https://"
当我将“git://”替换为“https://”时,问题就解决了
root@ubuntu:~# git clone git://github.com/osrg/ryu.git
Cloning into 'ryu'...
fatal: read error: Connection reset by peer
root@ubuntu:~# git clone https://github.com/osrg/ryu.git
Cloning into 'ryu'...
remote: Counting objects: 25613, done.
remote: Compressing objects: 100% (5/5), done.
Receiving objects: 37% (9609/25613), 18.68 MiB | 60.00 KiB/s
回答by Aaron Thompson
This can also be an issue when deleting repos (but not permanently). Make sure the repo is deleted in the trash/ recycling bin before cloning.
删除存储库(但不是永久)时,这也可能是一个问题。确保在克隆之前删除垃圾箱/回收站中的 repo。
Alternatively press SHIFT + DEL to delete a folder/ file permanently.
或者按 SHIFT + DEL 永久删除文件夹/文件。
回答by Rajan Twanabashu
This may be due to outdated git dependency library. Try updating curlfor your operating system.
这可能是由于过时的 git 依赖库。尝试为您的操作系统更新curl。
回答by Skitty
For the first issue
对于第一个问题
vijay13@ubuntu:~$ git clone git://anongit.kde.org/plasma-mediacenter
Cloning into 'plasma-mediacenter'...
fatal: read error: Connection reset by peer
Here you are trying to check out a code by using the above command. I even encounter this error : Connection reset by peer when try to check out a code.
在这里,您尝试使用上述命令检出代码。我什至遇到这个错误:当尝试签出代码时,对等方重置了连接。
It is a problem with your internet connection.
这是您的互联网连接问题。
Check your internet connection and try again.
检查您的互联网连接,然后重试。
It helped me.
它帮助了我。