Skip to content

Instantly share code, notes, and snippets.

@myfreeer
Forked from laispace/git 设置和取消代理
Last active June 4, 2021 02:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save myfreeer/f8ff88971fba689a3164d3c7485aab99 to your computer and use it in GitHub Desktop.
Save myfreeer/f8ff88971fba689a3164d3c7485aab99 to your computer and use it in GitHub Desktop.
git config --global http.proxy http://127.0.0.1:8087
git config --global https.proxy http://127.0.0.1:8087
git config --global --unset http.proxy
git config --global --unset https.proxy
set_proxy() {
git config http.proxy 127.0.0.1:8087
git config https.proxy 127.0.0.1:8087
git config http.sslVerify false
git fetch origin -f
}
unset_proxy() {
git config --unset http.proxy
git config --unset https.proxy
git config --unset http.sslVerify
}
npm config delete proxy
git_clone() {
git clone $* --config http.proxy=127.0.0.1:8087 --config http.sslVerify=false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment