在macOS上设置和取消Git代理
在 macOS 上设置和取消 Git 代理
设置 Git 代理
可以使用以下步骤在 macOS 上设置 Git 代理:
- 设置 HTTP 代理: 要设置 HTTP 代理,请在终端中运行以下命令:
# 项目配置
git config http.proxy http://proxy_username:proxy_password@proxy_ip:proxy_port
# 全局配置
git config --global http.proxy http://proxy_username:proxy_password@proxy_ip:proxy_port
请将proxy_username,proxy_password,proxy_ip和proxy_port替换为的代理的实际值。
- 设置 HTTPS 代理: 要设置 HTTPS 代理,请在终端中运行以下命令:
# 项目配置
git config https.proxy https://proxy_username:proxy_password@proxy_ip:proxy_port
# 全局配置
git config --global https.proxy https://proxy_username:proxy_password@proxy_ip:proxy_port
请将proxy_username,proxy_password,proxy_ip和proxy_port替换为的代理的实际值。
- 检查代理设置: 要检查代理设置是否正确,请在终端中运行以下命令:
git config --global --get http.proxy
git config --global --get https.proxy
这些命令将显示的 HTTP 和 HTTPS 代理设置。
取消 Git 代理
要取消 Git 代理,请在终端中运行以下命令:
- 取消 HTTP 代理: 要取消 HTTP 代理,请在终端中运行以下命令:
git config --global --unset http.proxy
- 取消 HTTPS 代理: 要取消 HTTPS 代理,请在终端中运行以下命令:
git config --global --unset https.proxy
- 检查代理设置: 要检查代理设置是否正确,请在终端中运行以下命令:
git config --global --get http.proxy
git config --global --get https.proxy
这些命令将显示的 HTTP 和 HTTPS 代理设置。
 
                    
                
 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号