Use the command to directly set the socks or http proxy.
socks proxy:
git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080'
You can also modify the ~/.gitconfig file directly.
vi ~/.gitconfig
Create or modify these two configurations
[http] proxy = socks5://127.0.0.1:1080 [https] proxy = socks5://127.0.0.1:1080
http/https proxy
git config --global http.proxy http://127.0.0.1:8080 git config --global https.proxy https://127.0.0.1:8080
Then git clone and other commands will automatically go to the proxy.
If you want to cancel the proxy:
git config --global --unset http.proxy git config --global --unset https.proxy
The parameters are temporary, and modifying the configuration file is a permanent change. After modification, it is best to restart git for the settings to take effect.
View configuration information:
git config -l --global
Execute View Agent
git config -l
Please like it if it is useful, and develop a good habit!
Questions, exchanges, encouragement, please leave a message!
git setup use proxy
Guess you like
Origin blog.csdn.net/libusi001/article/details/122229807
Ranking