【发布时间】:2018-06-28 02:01:37
【问题描述】:
我正在按照video 的说明添加第二个 github 帐户。但我收到了这个错误:
ssh: Could not resolve hostname github-secondAccount: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
这就是我所做的。
我添加了第二个 sshkey:
id_rsa
id_rsa.pub
id_rsa_secondAccount
id_rsa_secondAccount.pub
并且还创建了一个配置:
#first account
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
#secondAccount account
Host github-secondAccount
HostName github.com
User git
IdentityFile id_rsa_secondAccount
echo "# myNewRepo" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github-secondAccount:myUSer/myNewRepo.git
git push -u origin master
但在git push -u origin master 的那一刻,我收到了这个错误:
ssh: Could not resolve hostname github-secondAccount: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
你们中的任何人都知道我做错了什么或如何解决这个问题?
非常感谢您的帮助。
【问题讨论】: