Gitlab:无法连接到本地主机端口3128:连接被拒绝

时间:2019-12-22 19:43:48

标签: git connection gitlab

我刚刚创建了一个Gitlab帐户。然后我从机器上写下了以下命令:

cd /var/www/projet
git init
git add .
git commit -m "Initial commit"
git remote add origin https://gitlab.com/Alain83/touslesport.git
git push -u origin master

一切都很好,除了最后一个,我得到了:

  

致命:无法访问'https://User:password@gitlab.com/Alain83/touslesport.git/':无法连接到本地主机端口3128:连接被拒绝

如果我在浏览器中将https://User:password@gitlab.com/Alain83/touslesport.git写为网址,则可以连接到Gitlab中的projet。

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我正在使用Windows和cmder,以便能够启动git命令。 前两个命令结果:

λ git config http.proxy
http://localhost:3128
λ git config https.proxy
http://localhost:3128
λ echo %http_proxy%
http://localhost:3128
λ echo %https_proxy%
http://localhost:3128

我无法在我的环境中运行最后三个。我也认为我的代理有问题。我正在使用我公司的计算机。为避免代理出现问题,我使用了cntlm。如何设置cntlm,以便可以将文件从计算机传输到gitlab,反之亦然?