git使用代理

一、

在项目的根目录下,输入:git config --add http.proxy 127.0.0.1:8087(你的goagent本地端口)
并且remote server 使用github https 地址,就可以肆意的提交代码了。

二、

用ssh就好了(中括号替换成对应名字):
git remote set-url origin git@github.com:[username]/[reponame].git
前提是提交了公钥。
Windows下建议用 GitHub for Windows

三、

push的时候别用git协议,用https,
在./.git/config里添加:

[http]
proxy = http://127.0.0.1:8087
sslVerify = false

建议直接修改.gifconfig,免去每个项目都修改的麻烦。

原文地址:https://www.cnblogs.com/cloud2rain/p/3100380.html