小于 1 分钟
放到D:\Program Files\Git\cmd
下,命名为git-proxy
。
#!/bin/bash
case "$1" in
"off")
git config --global --unset http.proxy
git config --global --unset https.proxy
;;
"on")
git config --global http.proxy 127.0.0.1:${2:-7890}
git config --global https.proxy 127.0.0.1:${2:-7890}
;;
*)
git config --global --get http.proxy
git config --global --get https.proxy
exit 1
;;
esac
这样就能在bash命令行下运行git-proxy on