Last active
April 24, 2025 08:45
-
Star
(1,216)
You must be signed in to star a gist -
Fork
(280)
You must be signed in to fork a gist
-
-
Save laispace/666dd7b27e9116faece6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
npm config delete proxy |
前面的方法对我都不行,我的解决方法是:
- 下载 GitHub Desktop
- 打开
C:\Users\<UserName>\.gitconfig
[remote "origin"]
的proxy = http://127.0.0.1:代理端口
感谢灵神,在项目文件夹的".git\config"中添加proxy = http://127.0.0.1:代理端口
可以了
mac下 梯子ClashX 执行
git config --global http.https://git.521000.best.proxy socks5://127.0.0.1:7890
设置完成后, ~/.gitconfig文件中会增加以下条目:
[http "https://github.com"]
proxy = socks5://127.0.0.1:7890
再用https方式下载,会走梯子, 亲测有效!
mac下,仅仅设置 ~/.ssh/config 即可:
Host github.com
User git
ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
localhost和127.0.0.1不是一样的吗