引言
作为开发者,Git Clone 速度慢是常见问题。尤其是在拉取开源项目或临时修复 Bug 时,克隆过程可能长时间无进度甚至失败。

为什么 Git Clone 会这么慢?
导致 Git Clone 速度慢的主要原因包括:
- 网络环境问题:GitHub 服务器位于海外,访问时可能遇到丢包、限速或被墙,不同运营商网络情况差异较大。
- GitHub CDN 不稳定:GitHub 依赖 githubusercontent.com 作为对象存储,CDN 解析不稳定会导致速度波动。
- TLS 连接被中断:常出现
GnuTLS recv error (-110): The TLS connection was non-properly terminated报错,通常由 SSL 证书校验失败或 TLS 版本不兼容引起。 - 仓库体积太大:部分项目(如 TensorFlow、PyTorch)提交历史众多,默认克隆会拉取所有 commit 和分支。
- Git 配置问题:错误的代理配置或过旧的 Git 版本均会影响克隆速度。
实用的 Git Clone 加速方法
方法 1:使用国内 GitHub 镜像
适用场景:GitHub 访问慢、卡顿或无反应时。
1.1 使用 github.com.cnpmjs.org
git clone https://github.com.cnpmjs.org/hustvl/4DGaussians.git
由 cnpm 提供的加速服务,速度通常比官方源快数倍。
1.2 使用 gitclone.com
git clone https://gitclone.com/github.com/hustvl/4DGaussians.git
国内镜像,速度较快。
1.3 使用 ghproxy
git clone https://ghproxy.com/https://github.com/hustvl/4DGaussians.git
GitHub 代理服务器,支持加速 Git Clone 和 wget 下载。
1.4 使用 FastGit
git clone https://hub.fastgit.xyz/hustvl/4DGaussians.git
稳定性较好的国内加速站点。
方法 2:只拉取最新代码(浅克隆)
适用场景:仓库过大、Commit 过多,仅需最新代码时。
默认情况下 Git Clone 会拉取整个仓库历史。使用 --depth=1 仅拉取最新 Commit:
git clone --depth=1 https://github.com/hustvl/4DGaussians.git
如需获取完整历史,可执行:



