关于无法 Git github 项目的解决方法

关于无法 Git github 项目的解决方法

​ 今天上线突然发现没办法 git github 仓库的项目了,显示无法连接

​ 网上有一些解决方法说是修改 host 文件,但我觉得这对小白来说并不友好,我觉得最安全也最简单的方式还应该是使用代理服务器,这里可以查看一下你的代理使用的端口号,一般来说是 1080,如果你是用的是 clash 那默认的可能是 7890,这个需要去代理软件上自行查找

sh 复制代码
# 设置ss
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 https.proxy http://127.0.0.1:1080
 
git config --global https.proxy https://127.0.0.1:1080
 
# 取消代理
git config --global --unset http.proxy
 
git config --global --unset https.proxy
 
# 仅代理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

​ 打开你的 git bash ,输入设置代理的命令,这样就可以解决啦

中...(img-JqiZmPWW-1733389735798)]

相关推荐
Yvonne爱编码4 小时前
CSS- 4.1 浮动(Float)
前端·css·html·github·html5·hbuilder
冷yan~5 小时前
GitHub文档加载器设计与实现
java·人工智能·spring·ai·github·ai编程
Baoing_5 小时前
Git 项目切换到新的远程仓库地址
git
暴躁哥10 小时前
Git 版本控制系统入门指南
git
diving deep12 小时前
IDEA中git对于指定文件进行版本控制
git
趁你还年轻_16 小时前
记录一次git提交失败解决方案
git
关于不上作者榜就原神启动那件事18 小时前
git版本控制学习
git·学习
Cchaofan1 天前
Git/GitLab日常使用的命令指南来了!
git·gitlab
可乐加.糖1 天前
项目版本管理和Git分支管理方案
java·git·目标跟踪·gitlab·敏捷流程·源代码管理
wingaso1 天前
[经验总结]删除gitlab仓库分支报错:错误:无法推送一些引用到“http:”
linux·数据仓库·git