关于无法 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)]

相关推荐
云雾J视界1 小时前
开源协作2.0:GitHub Discussions+AI重构开发者社区的知识共创生态
人工智能·开源·github·discussions·知识共创·社区知识·ai重构
老程序员刘飞1 小时前
项目上传到GitHub流程
github
颇有几分姿色1 小时前
Git将本地项目推送到GitLab
git·gitlab
该用户已不存在2 小时前
这6个网站一旦知道就离不开了
前端·后端·github
Moment3 小时前
NestJS 在 2025 年:对于后端开发者仍然值得吗 😕😕😕
前端·后端·github
逛逛GitHub3 小时前
盘点本周 6 个火火火火 GitHub 开源项目。
github
xiaohe06015 小时前
🔒 JavaScript 不是单线程吗?怎么还能上“锁”?!
javascript·github
Kent_J_Truman6 小时前
Git个人配置偏好记录以及注意事项
git
小龙报8 小时前
《算法每日一题(1)--- 连续因子》
c语言·开发语言·c++·windows·git·算法·visual studio