git使用代理

2023-11-17  本文已影响0人  博楠同学

全局代理

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/
上一篇 下一篇

猜你喜欢

热点阅读