我正在通过代理使用gitlab,并且无法从本地存储库推送到远程存储库。我正在使用以下命令:
git remote add origin https://proxy-url/user/repo.git
git add .'''
git commit -m "Initial commit"
git push -u origin master
在使用push命令时,我收到以下错误消息:
fatal: unable to access 'https://proxy-url/user/repo.git/': Received HTTP code 403 from proxy after CONNECT
对此事的任何帮助将不胜感激!
答案 0 :(得分:1)
代理URL本身不应该是GitLab URL的一部分。
您只需设置/导出HTTP_PROXY
和HTTPS_PROXY
到该URL,该URL将在推送期间由Git拾取。
您也可以在git config http.proxy
设置中设置代理。
在两种情况下,该代理URL通常应该是HTTP,而不是HTTPS:
export HTTP_proxy=http://proxy/url
export HTTPS_proxy=http://proxy/url
^^^
still http, not https