github没有与名称相关的地址

oha*_*ana 7 git github

这些天我一直遇到github的问题,我在github上创建了一个新的存储库,然后从本地机器我尝试将我的代码推送到github:

git remote add origin git@github.com: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 git@github.com
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

这有什么不对?谢谢!

mip*_*adi 11

看:

fatal: remote origin already exists
Run Code Online (Sandbox Code Playgroud)

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

$ git remote set-url origin git@github.com:tmi/logger.git
Run Code Online (Sandbox Code Playgroud)


Ido*_*Ran 5

我有没有与名称问题相关的地址,搜索后它是一个DNS问题.DNS在计算机上出错了,无法找到远程git存储库的IP地址.

  • 是的,我有这个问题,我清除了我的DNS缓存.在Windows上,这是通过命令提示符使用ipconfig/flushdns完成的,然后我可以运行我的git命令,没有任何问题.所以,经验教训是git bash仍然使用本地操作系统DNS解析器. (2认同)