有时候git项目比较大,git clone会因为各种原因中断,但是Git并不会断点续“传”再次clone又是重新来过,类似这种问题…让人很是苦恼
1 | $ error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out |
解决方式
- git配置流
1 | $ git config --global http.lowSpeedLimit 0 // 最小速度 |
- 分块拉取
1 | $ git clone --depth=1 {repo} // 拉取最新的代码(最后一次commit) |
但这样会带来其他的小问题,就是拉下来的代码默认分支既不是master也不是其他分支 … 需要拉取完整的项目
1 | $ git fetch --unshallow // 拉取深层代码 |