赞
踩
# 为 git 设置: http 代理
git config --global http.proxy http://127.0.0.1:5002
git config --global https.proxy https://127.0.0.1:5002
# 为 git 设置: socket5 代理
git config --global http.proxy socks5://127.0.0.1:5002
git config --global https.proxy socks5://127.0.0.1:5002
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
#! /bin/bash # path: ~/bin/set-proxy-git if [[ $# -ne 1 ]]; then echo "usage: $0 <on/off>" >&2 exit fi choices=$1 if [ ${choices} = "on" ]; then echo "git config --global http.proxy http://127.0.0.1:5002" echo "git config --global https.proxy https://127.0.0.1:5002" fi if [ ${choices} = "off" ]; then echo "git config --global --unset http.proxy" echo "git config --global --unset https.proxy" fi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。