git GitHub - 无法连接到 github 443 windows/无法连接到 gitHub - 没有错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18356502/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 16:48:32  来源:igfitidea点击:

GitHub - failed to connect to github 443 windows/ Failed to connect to gitHub - No Error

gitgithub

提问by Anand

Q - I installed git to get the latest version of Angular. When I tried to run

问 - 我安装了 git 以获取最新版本的 Angular。当我试图跑

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

I got failed to connect to github 443 error

我无法连接到 github 443 错误

I even tried

我什至试过

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

That gave me failed to connect no error message.

这让我无法连接没有错误消息。

I am behind my company firewall. I can not see my proxy details when I go to control panel->Internet Options -> connections -> LAN setting. IT guys are not sharing proxy information with me. I do not know what to do ??

我在我公司的防火墙后面。当我转到 时,我看不到我的代理详细信息control panel->Internet Options -> connections -> LAN setting。IT 人员不会与我共享代理信息。我不知道该怎么办 ??

I finally managed to do it. I will update the procedure that I had taken in order to Just wanted to compile all the steps that I did to get it to work

我终于做到了。我将更新我采取的程序只是想编译我为使其工作所做的所有步骤

回答by Anand

Well I did following steps

好吧,我做了以下步骤

  1. Google the error

  2. Got to SO Links(here, here) which suggested the same thing, that I have to update the Git Config for proxy setting

  3. 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.

  4. Found this wonderful tutorialof finding which proxy your are connected to

  5. Updated the http.proxykey in git config by following command

  1. 谷歌错误

  2. 到 SO Links( here, here) 建议同样的事情,我必须更新 Git 配置以进行代理设置

  3. 该死,从控制面板看不到代理信息。IT人员一定把它隐藏了。我什至无法将设置更改为不使用代理。

  4. 找到了这个关于查找您连接到哪个代理的精彩教程

  5. http.proxy通过以下命令更新git config 中的密钥

git config --global http.proxy http[s]://userName:password@proxyaddress:port

git config --global http.proxy http[s]://userName:password@proxyaddress:port

  1. Error - could not resolve proxy some@proxyaddress:port. It turned out my password had @ symbol in it.

  2. Encode @in your password to %40, because git splits the proxy setting by @

  3. If your userName is a email address, which has @, also encode it to %40. (see this answer)

  1. 错误 - 无法解析代理some@proxyaddress:port。原来我的密码中有@符号。

  2. @将您的密码编码为%40,因为 git 通过 @ 拆分代理设置

  3. 如果您的用户名是一个电子邮件地址,其中有@,也将其编码为%40。(见这个答案

git config --global http.proxy http[s]://userName(encoded):password(encoded)@proxyaddress:port

git config --global http.proxy http[s]://userName(encoded):password(encoded)@proxyaddress:port

Baam ! It worked !

巴姆!有效 !

Note - I just wanted to answer this question for souls like me, who would come looking for answer on SO :D

注意 - 我只是想为像我这样的灵魂回答这个问题,他们会在 SO 上寻找答案:D

回答by Eric Wang

If your country or working environment blocks sites like Github.

如果您的国家或工作环境屏蔽了 Github 等网站。

Then you can build a proxy, e.g. use xxnet, which is free & based on Google's GAE, and available for Windows/ Linux/ Mac.

然后,你可以建立一个代理,例如使用xxnet,这是免费的和基于谷歌GAE,并供Windows/ Linux/ Mac

Then set proxy address for git, e.g:

然后为git设置代理地址,例如:

git config --global http.proxy 127.0.0.1:8087

回答by EvgenyKolyakov

If your git was already set to something and you only copied that folder to some other location, simply run:

如果您的 git 已经设置为某些内容并且您只将该文件夹复制到其他位置,只需运行:

git config --global http.proxy ""

And git will set itself straight, after what, you can pull again :)

并且 git 将自己设置为直,之后,您可以再次拉:)

回答by John Doe

Mine was fixed by just using this command :-

仅使用此命令即可修复我的问题:-

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

where XXX.XXX.XXX.XXX is the proxy server address and ZZ is the port number of the proxy server.

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

There was no need to specify any username or password in my case.

就我而言,无需指定任何用户名或密码。

回答by rmonte.com

I got so:

我是这样的:

git config --global http.proxy http://{domain}\\{username}:{password}@{proxy ip}:{proxy port}

git config --global http.sslverify false

回答by kinishinai

(Hope this answer help someone like me.)

(希望这个答案能帮助像我这样的人。)

The same problem happened to me in Windows using git for windows.

我在 Windows 中使用git for windows 也遇到了同样的问题。

I set proxy setting as usual:

我像往常一样设置代理设置:

git config --global http.proxy http://username:[email protected]:port

In my situation, the username is email, so it has a @ sign. After encode the @sign with %40in username, the problem is resolved.

在我的情况下,用户名是电子邮件,所以它有一个 @ 符号。 在用户名中用%40编码@符号后,问题解决。

So, encode the special characters not only in password, but also in username. (Refer to the comments of this answer)

因此,不仅要在密码中对特殊字符进行编码,还要在用户名中编码。(参考这个答案的评论)

回答by manuelbcd

I have wide experience working with corporate proxies. Configuration is usually working well with

我在公司代理方面拥有丰富的经验。配置通常与

But if you have configured the proxy and it's impossible to work with git (always getting 443 error) try to check if you have a remote.origin.proxy bypassing your configuration.

但是,如果您已经配置了代理并且无法使用 git(总是出现 443 错误),请尝试检查您是否有一个 remote.origin.proxy 绕过了您的配置。

git config --list --show-origin

If you check that "remote.origin.proxy" is configured as empty value try to unset it or almost set it with your corporate proxy:

如果您检查“remote.origin.proxy”是否配置为空值,请尝试使用您的公司代理取消设置或几乎设置它:

git config --add remote.origin.proxy "http://[yourproxy]:[yourport]"

And since several enterprise sites have untrusted certificates I recomend you to avoid certificate checking if you are using ssl:

由于几个企业站点的证书不受信任,我建议您在使用 ssl 时避免进行证书检查:

git config http.sslverify false    
git config --global http.sslverify false

回答by r_allela

Was getting the same error in SourceTree,go to Tools>Options>Networkand check Add proxy server configuration to Git/Mercurialif you had already set the proxy settings

在 SourceTree 中遇到同样的错误,如果您已经设置了代理设置,请转到工具>选项>网络并检查将代理服务器配置添加到 Git/Mercurial

回答by Jagath Gowda

On Windows 7 setting the proxy to global config will resolve this issue

在 Windows 7 上将代理设置为全局配置将解决此问题

git config --global http.proxy http://user:password@proxy_addr:port

git config --global http.proxy http://user:password@proxy_addr:port

but the problem here is your password will not be encrypted.. Hopefully that should not be much problem as most of time you will be sole owner of your PC.

但这里的问题是您的密码不会被加密。希望这不会有太大问题,因为大多数时候您将是您 PC 的唯一所有者。

回答by htpt

ipconfig /renew- solved this issue for me.

ipconfig /renew- 为我解决了这个问题。