Skip to content

Instantly share code, notes, and snippets.

@laispace
Last active April 19, 2024 09:26
Show Gist options
  • Save laispace/666dd7b27e9116faece6 to your computer and use it in GitHub Desktop.
Save laispace/666dd7b27e9116faece6 to your computer and use it in GitHub Desktop.
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
@EndlessCheng
Copy link

前面的方法对我都不行,我的解决方法是:

  1. 下载 GitHub Desktop
  2. 打开 C:\Users\<UserName>\.gitconfig
  3. [remote "origin"]proxy = http://127.0.0.1:代理端口

@pochenyun
Copy link

pochenyun commented Feb 17, 2024

有的代理好像不允许22端口,改443或者别的什么就行了:

Host github.com
    Hostname ssh.github.com
    User git
    Port 443
    IdentityFile ~/.ssh/xxx

@SeaAster
Copy link

SeaAster commented Mar 9, 2024

前面的方法对我都不行,我的解决方法是:

  1. 下载 GitHub 桌面版
  2. 开放C:\Users\<UserName>\.gitconfig
  3. [remote "origin"]proxy = http://127.0.0.1:代理端口

适合我, 感谢!

@liyiersan
Copy link

win10系统,结合前面几位老哥的,在config文件中加入这几句: Host github.com User git ProxyCommand connect -S 127.0.0.1:7891 %h %p

测试有效,我也用是的Clash,最开始打开System Proxy(系统全局代理)都没用。 我的git不知道什么版本的,config文件的路径是C:\Program Files\Git\etc\ssh\ssh_config,用记事本打开然后加上上面三句就可以了,注意改一下端口跟你clash中的端口一致,我的是7891

太感谢了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment