GitHub上的Push to remote指向一个新的服务器IP

GitHub上的Push to remote指向一个新的服务器IP,git,github,ssh,Git,Github,Ssh,我不知道发生了什么变化,但当我试图推到GitHub上的遥控器时,它转到了一个完全未知的IP,这让我大吃一惊 [slavik@localhost guardonce]$ git push origin master Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts. Connection closed by 192.30.252.128 fat

我不知道发生了什么变化,但当我试图推到GitHub上的遥控器时,它转到了一个完全未知的IP,这让我大吃一惊

[slavik@localhost guardonce]$ git push origin master
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Connection closed by 192.30.252.128
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
其他测试表明,我的本地计算机的配置良好。例如:

[slavik@localhost guardonce]$ ssh -T git@github.com
Hi slavik81! You've successfully authenticated, but GitHub does not provide shell access.


看看我的已知主机,我希望能与github.com,204.232.175.90对话。那么,我为什么不呢?

检查现有的远程url

git config remote.origin.url
如果不正确,您可以通过以下方式进行更改:

git remote set-url origin git@github.com:slavik81/guardonce.git

git推送的url列在config文件夹中。在应用程序中查找.git文件夹,然后打开其中的配置文件

$ cat config 
[core]
repositoryformatversion=0
filemode=true
裸=假
logallrefupdates=true
[远程“源”]
fetch=+refs/heads/*:refs/remotes/origin/*
url=git@github.com:******/*********吉特
[分行“主控”]
远程=原点
合并=参考/头/主
[分支“sprint_1”]
远程=原点
合并=参考/头部/冲刺1


签出远程“源”的url,它显示远程当前url。您可以在这里进行更改。

这是加利福尼亚州的github服务器

$ git config remote.origin.url
git@github.com:blah/foo
$ ping github.com
PING github.com (192.30.252.128) 56(84) bytes of data.
64 bytes from 192.30.252.128: icmp_seq=1 ttl=47 time=63.6 ms

编辑: 在过去几天中,他们受到了严重的DDoS攻击,因此他们可能这样做是为了帮助抵御攻击。

现在(2013年8月25日)发生的变化在“”中解释为:

我们提到了这些新地址,并更新了地址以反映它们。
一些GitHub服务已迁移到新地址,包括:

我们的下一步是开始将这些IP地址用于GitHub主站点,因此我们提醒所有人这一更改。
有几个问题可能会影响某些人:

  • 如果您有明确的防火墙规则,允许从您的网络访问GitHub,那么您需要确保本文中列出的所有IP范围都包括在内

  • 如果您的
    /etc/hosts
    文件中有一个条目指向特定的IP地址
    github.com
    ,则应将其删除,并依靠DNS为您提供最准确的地址集

  • 如果您通过SSH协议访问存储库,则每次客户端连接到
    github.com

    只要警告中的IP地址在前面提到的帮助页面中的IP地址范围内,您就不必担心。
    具体地说,这次添加的新地址在192.30.252.0到192.30.255.255之间。
    警告消息如下所示:


如果使用
capistrano
gem进行部署,它会在服务器上的
deploy\u dir/shared/cached copy
中克隆repo

只需删除
deploy\u dir/shared/cached copy
目录


$rm-rf部署目录/共享/缓存副本


然后再次部署。

我得到
git@github.com:slavik81/guardonce.git
作为输出,这似乎很好。重做推动使我成功了。。。这很奇怪。这是一个有用的答案,当时我很满意,但VonC更彻底地解开了我的谜团。很抱歉不能接受。@Slavik81没问题。好的答案必须被接受,以便其他人更容易找到。这是一个GitHub IP,但我在上找不到任何关于它的信息。GitHub的上一篇博文解释了这一点:请参阅
$ git config remote.origin.url
git@github.com:blah/foo
$ ping github.com
PING github.com (192.30.252.128) 56(84) bytes of data.
64 bytes from 192.30.252.128: icmp_seq=1 ttl=47 time=63.6 ms
api.github.com
gist.github.com
ssh.github.com
Warning: Permanently added the RSA host key for IP address '$IP' to the list of known hosts.