git没有连接我的工作代理

时间:2014-12-04 06:09:33

标签: git ssh proxy

我希望git使用127.0.0.1:8080代理连接

以下是http.proxyhttps.proxy

的输出
$ git config --get http.proxy
http://127.0.0.1:8080

$ git config --get https.proxy
http://127.0.0.1:8080

我为我的系统设置了这个代理,它正在使用chrome,Firefox,Gradle,Android Studio。所以我相信这是正确的。但是git无法从远程存储库中获取我的代码。

这是消息(来自SourceTree):

ssh: connect to host bitbucket.org port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我确信拥有正确的访问权限。

为什么git不使用该代理?

我是否也必须为ssh设置代理信息?怎么样?

1 个答案:

答案 0 :(得分:0)

  

为什么git不使用该代理?
  我是否也必须为ssh设置代理信息?怎么样?

因为ssh没有使用 http 代理。完全没有。

你可以:

  • 切换到您的BitBucket回购的https网址

    git remote set-url origin https://<username>@bitbucket.org/<username>/myrepo.git
    
  • 或确保端口22已打开(未被防火墙阻止)