[Git] Configuring and Removing Git Proxy

When configuring Git to use a proxy, you can use the following commands to set and remove the proxy:

Configuring Git Proxy

To configure HTTP and HTTPS proxies for Git, use the following commands:

1
2
3
4
5
# Configure HTTP proxy
git config --global http.proxy http://127.0.0.1:1080

# Configure HTTPS proxy
git config --global https.proxy https://127.0.0.1:1080

Removing Git Proxy Configuration

To remove the proxy settings, use the following commands:

1
2
3
4
5
# Remove HTTP proxy
git config --global --unset http.proxy

# Remove HTTPS proxy
git config --global --unset https.proxy

Explanation

  • git config --global http.proxy <proxy-url>: Configure the global HTTP proxy.
  • git config --global https.proxy <proxy-url>: Configure the global HTTPS proxy.
  • git config --global --unset http.proxy: Remove the global HTTP proxy configuration.
  • git config --global --unset https.proxy: Remove the global HTTPS proxy configuration.

With these commands, you can easily enable or disable Git proxy settings as needed.

Licensed under CC BY-NC-SA 4.0