ruby-on-rails – 無法推送到github,ssh:無法解析主機名
我不能通過這個,多次重建儲存庫,使ssh金鑰結束
-------------- demo_app <username>$git remote add origin [email protected]:<username>/demo_app.git fatal: remote origin already exists. $git push -u origin master --- ssh: Could not resolve hostname git: nodename nor servname provided, or not known --- fatal: Could not read from remote repository. --- Please make sure you have the correct access rights --- and the repository exists. ---------- --------- Checked ssh keys --- $ssh -T [email protected] Hi <username>! You've successfully authenticated, but GitHub does not provide shell access. ---
仍然收到相同的訊息.
而不是新增一個新的遠端,請嘗試使用以下命令更改現有的遠端:
git remote set-url origin [email protected]:<username>/demo_app.git
編輯:所以,這裡是使它的工作,而不會丟失你的程式碼的命令.
> rm -rf .git
> git init
git remote add origin [email protected]:<username> /demo_app.git
> git commit –allow-empty -m’首先提交’
> git push origin master
程式碼日誌版權宣告:
翻譯自:http://stackoverflow.com/questions/16548173/cannot-push-to-github-ssh-could-not-resolve-hostname