git clone fatal: The remote end hung up unexpectedly

  • git clone error
    随着项目的更新.git越来越大,最近在一台新的mac上clone项目时一直失败,出现The remote end hung up unexpectedly的异常, 此问题可能由网络原因引起。

下面是git clone error日志:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone https://[email protected]/alpface/alpface.git /Users/xiaoyuan/Destop/work/GitHub/alpface 
Cloning into '/Users/xiaoyuan/Destop/work/GitHub/alpface'...
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
Completed with errors, see above
屏幕快照 2018-09-27 下午2.04.48.png

解决方法
配置git的最低速度和最低速度时间 单位 秒:

git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999  
  • pod install error:
xiaoyuan:alpface xiaoyuan$ pod install
Analyzing dependencies
Downloading dependencies
Installing Alamofire (4.7.3)

[!] Error installing Alamofire
[!] /usr/bin/git clone https://github.com/Alamofire/Alamofire.git /var/folders/9n/2_q48v8j049bnt5m4k7c_4rh0000gq/T/d20180927-43344-18k5hqm --template= --single-branch --depth 1 --branch 4.7.3

Cloning into '/var/folders/9n/2_q48v8j049bnt5m4k7c_4rh0000gq/T/d20180927-43344-18k5hqm'...
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

原因:mac安装了多个xcode
解决方法:
打开终端输入以下,然后再重新pod install即可

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

你可能感兴趣的:(git clone fatal: The remote end hung up unexpectedly)