您至少需要设置一个HTTP_PROXY
变量环境。
set HTTPS_PROXY=http://<login_internet>:<password_internet>@aproxy:aport
set HTTP_PROXY=http://<login_internet>:<password_internet>@aproxy:aport
或者,bash命令:
export http_proxy=http://<login_internet>:<password_internet>@aproxy:aport
export https_proxy=http://<login_internet>:<password_internet>@aproxy:aport
确保%HOME%
(或$ HOME)设置到你做存储您.ssh
配置
然后,Git命令目录:
git config --system http.sslcainfo \\bin\\curl-ca-bundle.crt
git config --global http.proxy http://<login_internet>:<password_internet>@aproxy:aport
git config --global user.name <short_username>
git config --global user.email <email>
git config --global github.user <github_username>
git config --global github.token <github_token>
注:bash命令:
git config --system http.sslcainfo /bin/curl-ca-bundle.crt
为了避免GitHub的询问您的密码,在你的HOME
(或对于bash会话的.netrc
)创建_netrc
文件
machine github.com
login <login_github>
password <password_github>
更新2012
注意since git1.7.10(2012 ),您可以使用credential caching mechanism以避免以纯文本形式存储您的登录名/密码(在%HOME%/_netrc
文件中)。
如果你有关于\\ bin \\ curl-ca-bundle.crt的错误,你可以使用:git config --global http.sslverify“false” – DarkteK 2016-07-20 18:51:59
@GonzaloJarjury这不是我会推荐的做法。始终尝试验证您的证书。首先尝试,即使在最新版本的Git的Windows上:'git config --system http.sslcainfo/ssl/certs/ca-bundle.crt' – VonC 2016-07-20 18:54:59