无法通过代理URL推送到gitlab

问题描述 投票:0回答:1

我正在通过代理使用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

在此问题上的任何帮助将不胜感激!

git gitlab git-push gitlab-api
1个回答
0
投票

代理URL本身不应该是GitLab URL的一部分。

您只需将HTTP_PROXYHTTPS_PROXY设置/导出到该URL,该URL将在推送期间由Git拾取。您也可以在git config http.proxy设置中设置代理。

在两种情况下,该代理URL通常应该是HTTP,而不是HTTPS:

git config http.proxy
© www.soinside.com 2019 - 2024. All rights reserved.