2010-07-19 36 views
7

相关的地址我一直有问题,github上,这些天,我创建了新仓库,然后从本地机器我试图把我的代码github上:github上没有与名称

 
git remote add origin [email protected]:tmi/logger.git 
fatal: remote origin already exists 

git push origin master 
ssh: github.com:uhdyi: no address associated with name 
fatal: the remote end hung up unexpectedly 

ssh git -v 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Fed 2007 
ssh: git: no address associated with name 

ssh [email protected] 
Enter passphrase for key '/c/Documents and Settings/tmi/.ssh/id_rsa': 
Error: HI, tmi! you've successfullly authenticated, but GitHub doesn not provide shell access 
connection to github.com closed 

git push origin master 
ssh: github.com:uhdyi: no address associated with name 
fatal: the remote end hung up unexpectedly 

有什么不对吗?谢谢!

回答

11

看:

fatal: remote origin already exists 

您已经有一个名为远程origin,它仍然使用旧的,无效的URL。打开.git/config并更改网址为origin遥控器,或者使用git remoteset-url子命令:

$ git remote set-url origin [email protected]:tmi/logger.git 
+0

'ssh:git:没有与name相关的地址和'fatal:remote origin already exists?'是两个单独的问题。前者的解决方案是什么? – 2011-11-16 21:37:11

+0

对我来说''ssh:git:没有与name相关的地址'发生了,因为我的互联网连接在虚拟机中被破坏了 – bendytree 2013-04-04 20:07:57

4

如何将错误

ssh git -v 
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Fed 2007 
ssh: git: no address associated with name 

涉及到

fatal: remote origin already exists? 

而且couldn这个问题可以通过

解决
git remote add someothername [email protected]:tmi/logger.git 
+0

'ssh:git:没有与name相关的地址和'fatal:remote origin already exists?'的确是两个单独的问题,不幸的是,米帕迪只回答后者。 – 2011-11-16 21:35:10

5

我有没有地址与名称问题相关联,并在搜索后是DNS问题。 DNS在机器上只是错了,它找不到远程git存储库的IP地址。

+2

是的,我有这个问题,我清除了我的DNS缓存。在Windows上,这是通过使用ipconfig/flushdns命令提示符完成的 然后,我可以运行我的git命令而没有任何问题。所以,经验教训是,git bash仍然使用本地操作系统DNS解析器。 – Finster 2014-03-13 15:50:24