Git克隆时报443错误,设置代理解决连接git超时问题

2023年3月23日服务端评论47,052字数 747阅读2分29秒阅读模式

克隆仓库时报了一个443的错误,错误信息显示:连接仓库失败,操作超时。

网络连接真的是坑……

吐槽无用,直接解决问题吧,通过配置git的代理,即可解决。

首先你要知道自己代理工具使用的端口号,比如我用的这款,混合端口走的是7890,记住这个端口号。

然后使用下面的命令,修改下http代理即可,

最后的端口号记得修改为你自己工具的。

全局设置(不推荐)

#使用http代理 
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy https://127.0.0.1:7890
#使用socks5代理
git config --global http.proxy socks5://127.0.0.1:7890
git config --global https.proxy socks5://127.0.0.1:7890

只对Github代理(推荐)

#使用socks5代理(推荐)
git config --global http.https://github.com.proxy socks5://127.0.0.1:7890
#使用http代理(不推荐)
git config --global http.https://github.com.proxy http://127.0.0.1:7890

取消代理
当你不需要使用代理时,可以取消之前设置的代理。

git config --global --unset http.proxy git config --global --unset https.proxy

Ethan_2023-03-22_10-20-19

可以看到我使用了git config --global http.proxy http://127.0.0.1:7890配置好代理后就可以正常登录了,至此问题解决,特此记录。

Git 的基础使用及命令汇总 服务端

Git 的基础使用及命令汇总

仅自用,内容仅仅保证自己看得懂 常用基础命令 git init - 初始化仓库 git clone - 拷贝远程仓库 git status - 显示变更 git add . - 添加文件到暂存区 gi...
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定