全局代理
git config --global http.proxy http://127.0.0.1:12333
git config --global https.proxy https://127.0.0.1:12333
仅针对github进行代理
git config --global http.https://github.com.proxy http://127.0.0.1:12333
# 这一行可以不写,这个是代理ssh的方式,如果需要这样需要先把秘添加进github
git config --global url."git@github.com:".proxy http://127.0.0.1:12333
go get的时候会使用git的http,私有库会使用https需要使用账号密码
使用http转ssh
git config --global url."git@gitlab.com:".insteadOf https://gitlab.com/
网友评论