git不走翻墙

用户头像
作者:新鲜噩梦
简介:little笔记全栈作者
创建于:2025-07-14 08:13:04字数:1043
发现git下载东西老是不走我的翻墙软件!翻墙软件设置全局代理还设置不了,不起作用!!
找到翻墙软件的端口
然后运行如下命令
bash
git config --global http.proxy 127.0.0.1:7890 git config --global https.proxy 127.0.0.1:7890
其他相关命令
查看当前代理,
如果没有设置代理,就什么也不显示。
bash
git config --global --get http.proxy git config --global --get https.proxy
如果哪天代理废了,可以用下面命令取消代理,不然你用github会报错!!
取消当前代理
bash
git config --global --unset http.proxy git config --global --unset https.proxy
可以在工程目录下找到.git文件
找到config文件
添加:
bash
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = https://github.com/fengjinlovewei/nest-demo.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "main"] remote = origin merge = refs/heads/main [http] proxy = http://127.0.0.1:7890 [https] proxy = http://127.0.0.1:7890
最后编辑于:2025-09-24 18:14:29
©著作权归作者所有,转载或内容合作请联系作者。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,little笔记系信息发布平台,仅提供信息存储服务。