Last active
March 14, 2016 06:00
-
-
Save tkhoa2711/963adc1a687476a7eb01 to your computer and use it in GitHub Desktop.
Update http(s) proxy settings for git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read in username and password for system http(s) proxy settings | |
read -s -p "Username: " USERNAME; echo '' | |
read -s -p "Password: " PASSWORD; echo '' | |
read -s -p "HTTP(S) Proxy (host:port): " HTTP_PROXY_HOST_PORT; echo '' | |
export {http_proxy,https_proxy}="http://$USERNAME:$PASSWORD@$HTTP_PROXY_HOST_PORT" | |
# update http(s) proxy settings for git | |
git config --global http.proxy $http_proxy | |
git config --global https.proxy $https_proxy | |
git config --global http.sslVerify false | |
git config --global https.sslVerify false | |
# you may want to limit access to this config from now on | |
chmod 600 ~/.gitconfig | |
# and probably unset the env variables | |
unset USERNAME PASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment