我在本地机器上有一个推送到github的git存储库和一个临时服务器,该服务器由HostGator托管。我跟随this guide设置了我的临时服务器,以允许我推送到它,这在过去运行得很好。
在大约一个月没有推送任何东西之后,当我尝试推送到临时服务器(其中hostname被替换为我的url)时,我看到了这个错误:
ssh: connect to host [hostname] port 22: Operation timed out
fatal: The remote end hung up unexpectedlygit remote -v显示:
bright [user]@[hostname]:[path to repo] (fetch)
bright [user]@[hostname]:[path to repo] (push)
origin git@github.com:[reponame.git] (fetch)
origin git@github.com:[reponame.git] (push)我的.git/config的相关部分如下:
[remote "[remote in question"]
url = [user]@[hostname]:[path to repo]
fetch = +refs/heads/*:refs/remotes/[remote]/*值得注意的是,当我通过ssh连接到此服务器时,我使用的是端口2222,但正如您从错误消息中看到的,git正在尝试使用端口22。我认为这是一直以来的情况,即使这是正确的工作。
我可以采取哪些步骤来确定我的临时服务器上git push超时的原因?
发布于 2013-01-05 01:20:59
听起来您可能在本地~/.ssh/config文件中设置了端口2222。也许那个配置被替换或删除了?
发布于 2013-01-05 01:23:56
您需要使用以下命令在远程定义中指定端口:
url = git://[user]@[host]:2222/[path_to_repo]这只能使用以git://开头的上述样式的url。
https://stackoverflow.com/questions/14161694
复制相似问题