Q -我安装了git来获得最新版本的Angular。当我试图逃跑的时候

git clone https://github.com/angular/angular-phonecat.git

我得到失败连接到github 443错误

我甚至尝试过

git clone git://github.com/angular/angular-phonecat.git

这给了我失败的连接没有错误消息。

我在公司的防火墙后面。当我进入控制面板->Internet选项->连接-> LAN设置时,我无法看到我的代理详细信息。IT人员不会和我分享代理信息。我不知道该怎么办?

我终于做到了。我将更新我所采取的程序,以便 只是想编译所有的步骤,我做了让它工作


当前回答

我的问题被修复了,只需使用这个命令:-

      >git config --global http.proxy XXX.XXX.XXX.XXX:ZZ

其中XXX.XXX.XXX.XXX是代理服务器地址 ZZ为代理服务器的端口号。

在我的例子中,不需要指定任何用户名或密码。

其他回答

我的问题被修复了,只需使用这个命令:-

      >git config --global http.proxy XXX.XXX.XXX.XXX:ZZ

其中XXX.XXX.XXX.XXX是代理服务器地址 ZZ为代理服务器的端口号。

在我的例子中,不需要指定任何用户名或密码。

我通过将dns名称服务器更改为8.8.8.8解决了我的问题

我按照下面的步骤做了

Google the error Got to SO Links(here, here) which suggested the same thing, that I have to update the Git Config for proxy setting Damn, can not see proxy information from control panel. IT guys must have hidden it. I can not even change the setting to not to use proxy. Found this wonderful tutorial of finding which proxy your are connected to Updated the http.proxy key in git config by following command git config --global http.proxy http[s]://userName:password@proxyaddress:port Error - "could not resolve proxy some@proxyaddress:port". It turned out my password had a @ symbol in it. Encode @ in your password to %40, because git splits the proxy setting by @ If your userName is a email address, which has @, also encode it to %40. (see this answer) git config --global http.proxy http[s]://userName(encoded):password(encoded)@proxyaddress:port

Baam !它工作!

注:我只是想为像我这样的灵魂回答这个问题,谁会来寻找答案的SO:D

我在防火墙后面使用msys2 git,这个解决方案对我有用:

一个非常简单的解决方案:用git://替换https://

我在Windows 10(和Windows 11)的代理后面,git 2.32.0.window.1。这对我来说很管用。

检查你拥有的东西

使用以下命令检查全局配置:

$ git config --global --list

您应该看到user.name、user的设置。邮件等。以下几行代码为我解决了这个问题:

http.proxyauthmethod=basic
http.proxy=http://username:password@proxyaddress:port
https.proxy=https://username:password@proxyaddress:port

注意,这些都是http和https协议的设置。如果你两个都看不到,你必须设置它们。

设置代理

在控制台中使用这行代码,用于两个协议:

$ git config --global https.proxy https://username:password@proxyaddress:port

如果有必要的话:

$ git config --global http.proxy http://username:password@proxyaddress:port`

如果您不知道代理和端口是什么,请在Windows系统(控制面板)中查找Internet选项(或属性)窗口菜单。

Internet属性(窗口)→连接(标签)→局域网设置(按钮)→代理服务器(剖面)→高级(按钮)

并且,请记住将所有值(id est:用户名、密码、proxyaddress和端口)替换为实际值(在proxyaddress中,您必须设置一个ip编号)。

请记住,您可能需要将其中一些值保留为空(因为代理不需要它们)。例如,有一次我必须设置:

git config --global http.proxy http://:@10.1.33.244:81

正如您可能注意到的,不需要用户名或密码。

有用的Bash脚本

由于我每天都要设置和取消系统的代理配置,所以我编写了这个小脚本:Gist

NOTE

如果您需要访问GitLab,在我刚刚描述的步骤之后,您可能需要遵循以下步骤:GitLab身份验证需要令牌

当您尝试克隆存储库时,系统将提示您输入GitLab用户名和密码。您不需要输入常规密码,而是需要提供一个生成的令牌。用户名相同。