本文介绍了git推/拉超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法从我的公司vpn git push / pull到github:

  git push origin master 
ssh:连接到主机github.com端口22:连接超时
致命:远程端意外挂起

我认为这是一个防火墙问题,如果我从它的vpn断开连接,b / c。我能做些什么来解决它吗?或者当我需要推/拉时,我坚持断开vpn?

使用,但这种效果通常是由于VPN设置路由了VPN上的所有流量。你可以通过更新你的路由表来将流量路由到github,而不是通过VPN,而不是通过你的以太网(我假设)接口。\\ b
$ b

例如 route add 65.74.177.129 eth0 将通过eth0路由流量到github。这是Linux语法; Windows有一个路由命令,它的用法大致相同。



(这实际上并不是一个特定于git的问题,事实上,您应该能够演示通过尝试连接到任何客户端(例如telnet,nc或PuTTY:sshd),尝试连接到github.com端口22时,问题通常会在连接时立即打印带有其版本号的横幅)


I can't git push/pull to github from my corporate vpn:

git push origin master
ssh: connect to host github.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly

I assume this is a firewall issue, b/c if I disconnect from the vpn it works. Is there anything I can do to work around it? Or am I stuck disconnecting from the vpn when I need to push/pull?

解决方案

Not sure which type of VPN you're using, but this sort of effect is usually due to the VPN setup routing all your traffic over the VPN. You can work around that by updating your routing tables to route traffic to github back over your Ethernet (I assume) interface rather than over the VPN.

For example route add 65.74.177.129 eth0 will route traffic to github over eth0. This is the Linux syntax; Windows has a "route" command as well that is broadly similar.

(This isn't really a git-specific problem, and in fact you should be able to demonstrate the problem by trying to connect to github.com port 22 with any client such as telnet, nc or PuTTY: sshd will usually print a banner with its version number as soon as you connect)

这篇关于git推/拉超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 22:00