查看git配置

git config  --list
git config --global --list

配置proxy

两种proxy方式

走http/https形式:git clone https://github.com/xxxxx
走ssh 形式:git clone git@github.com:xxxxx

走http/https

git config --global http.proxy "http://127.0.0.1:7890"
git config --global https.proxy "https://127.0.0.1:7890"

取消proxy

git config --global --unset http.proxy
git config --global --unset https.proxy

走ssh

修改 .ssh/config 文件(不存在则新建,Windows 一般在 C:\Users\YourName.ssh)文件夹下面新建一个文件 config,注意没有任何后缀名,就叫 config):

# 必须是 github.com
Host github.com
   HostName github.com
   User git
   # 走 HTTP 代理
   ProxyCommand connect -H 127.0.0.1:7890 %h %p
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐