Skip to content

Instantly share code, notes, and snippets.

@xight
Created October 28, 2016 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xight/fb03009fb725e33245c0697386d9836f to your computer and use it in GitHub Desktop.
Save xight/fb03009fb725e33245c0697386d9836f to your computer and use it in GitHub Desktop.
set-proxy.sh
function set_proxy() {
export http_proxy=$1
export HTTP_PROXY=$1
export ftp_proxy=$1
export FTP_PROXY=$1
export all_proxy=$1
export ALL_PROXY=$1
export https_proxy=$1
export HTTPS_PROXY=$1
git config --global http.proxy $1
git config --global https.proxy $1
git config --global url."https://".insteadOf git://
}
function set_no_proxy() {
export NO_PROXY=$1
export no_proxy=$1
}
function unset_proxy() {
unset http_proxy
unset HTTP_PROXY
unset ftp_proxy
unset FTP_PROXY
unset all_proxy
unset ALL_PROXY
unset https_proxy
unset HTTPS_PROXY
git config --global --unset http.proxy
git config --global --unset https.proxy
git config --global --unset url."https://".insteadOf
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment