征服git clone与git pull的龟速提交 - SunSeekerX

/ 0评 / 0
内容纲要

征服git clone与git pull的龟速提交

首先为啥起名为征服,因为公司的项目用到了gitlab,之前提交代码的速度一直为10-20KB,,由于代码不是很多,多人也没发现啥问题,就是慢了一点,能忍受。(一直用的ssh连接)

然后,然后一次慢的离谱的速度导致加班了3小时。。。🙃,10-20KB的速度无法满足越来越大的项目。

windos教程

1️⃣ 使用酸酸乳(ssr)

右键右下角小飞机图标➡️找到选项设置➡️勾选允许来自局域网的连接➡️确定

2️⃣ 打开Git Bash

Git全局配置http代理

只能代理http连接!!!

# 代理
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
# 上面不生效用
git config --global http.proxy 'socks5://127.0.0.1:1080' 
git config --global https.proxy 'socks5://127.0.0.1:1080'

# 只对 github 进行代理,对国内的仓库不影响,可以这样设置,不熟悉配置文件不建议使用
git config --global http.https://github.com.proxy https://127.0.0.1:1080
git config --global https.https://github.com.proxy https://127.0.0.1:1080
# 只对 gitlab 进行代理,对国内的仓库不影响,可以这样设置,不熟悉配置文件不建议使用
git config --global https.https://https://gitlab.com.proxy https://127.0.0.1:1080

# 恢复
git config --global --unset http.proxy
git config --global --unset https.proxy

3️⃣ 打开小飞机,clone代码吧

亲测代码提交速度从10-20K增加到4-5M

发表评论

您的电子邮箱地址不会被公开。