Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active December 12, 2017 20:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save garystafford/8197021 to your computer and use it in GitHub Desktop.
Save garystafford/8197021 to your computer and use it in GitHub Desktop.
v2 of compact version of https://gist.github.com/garystafford/8128922. v2 Gist for blog post 'Revised Configuration of Git for Windows on a Corporate Network with Vagrant'. Easily turn proxy-related settings on and off for Git for Windows. 1) Add these functions to your ~\.bashrc file, 2) Open new Git Bash interactive shell window and execute fu…
function proxy_on(){
export HTTP_PROXY="http://$USERNAME:$PASSWORD@$PROXY_SERVER.$USERDNSDOMAIN:$PROXY_PORT"
export HTTPS_PROXY="$HTTP_PROXY" FTP_PROXY="$HTTP_PROXY" ALL_PROXY="$HTTP_PROXY" \
NO_PROXY="localhost,127.0.0.1,*.$USERDNSDOMAIN" \
GIT_CURL_VERBOSE=1 GIT_SSL_NO_VERIFY=1
echo -e "\nProxy-related environment variables set."
}
function proxy_off(){
variables=( "HTTP_PROXY" "HTTPS_PROXY" "FTP_PROXY" "ALL_PROXY" \
"NO_PROXY" "GIT_CURL_VERBOSE" "GIT_SSL_NO_VERIFY" )
for i in "${variables[@]}"; do unset $i; done
echo -e "\nProxy-related environment variables removed."
}
# if you are always behind a proxy uncomment below
#proxy_on
# increase verbosity of Vagrant output
export VAGRANT_LOG=INFO
@garystafford
Copy link
Author

v2 Version Changes

  • PASSWORD, PROXY_SERVER, PROXY_PORT moved to Windows user-level environment variables
  • DOMAIN environment variable removed. Problems with Vagrant using DOMAIN in URI! Use fqdn for PROXY, instead: http://username:password @ proxy.domain.tld:port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment