2010-07-19 60 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