Git提速


看了一堆的git加速,解决办法无非

  • 修改host——真的有用吗?

  • 使用代理——取决于代理的速度,该慢的(。・∀・)ノ゙嗨得慢,突然想到了一个配钥匙的故事。

这里还是贴一个代理配置,对于 commit 到 github 还是不错的选择

http

git config --global http.proxy 127.0.0.1:1081

https

git config --global https.proxy 127.0.0.1:1081

socks5

git config --global http.proxy socks5://127.0.0.1:1080

git config --global https.proxy socks5://127.0.0.1:1080

取消代理

git config --global --unset http.proxy

git config --global --unset https.proxy
  • 使用第三方代码托管形如:gitee。从gitee导入github的仓库,然后再从gitee clone ——试过一次,发现导入gitee一直都卡在那里了。

  • 推荐如下方法,至少在2020年09月01日 00:19:57还算好使,用过的都说飞起来了!

git clone一个github上的仓库,太慢,经常连接失败,但是github官网流畅访问,为什么? - Don.hub的回答 - 知乎

原理:看评论,貌似是有好心的大佬搞了个镜像

关键点:将git地址中的 github.com 改成 github.com.cnpmjs.org

下面是一个示例

# 原始git地址
https://github.com/pudgelee/pudgeLeeBlogComment.git

# 将 github.com 改成 github.com.cnpmjs.org
https://github.com.cnpmjs.org/pudgelee/pudgeLeeBlogComment.git

说明:源答案是要求加 wwwwww.github.com.cnpmjs.org,ping了一下 www.github.com.cnpmjs.org 貌似不通,对于我来说 github.com.cnpmjs.org才有效果。

更改 git 远程地址

通过上述方法clone的仓库远程地址变成了 https://github.com.cnpmjs.org/pudgelee/pudgeLeeBlogComment.git ,现在暂时不晓得

push 的时候有没有影响,顺手改回来吧。

使用git remote -v查看远程地址


git remote -v


文章作者: PudgeLee
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 PudgeLee !
评论