【发布时间】:2019-10-31 12:22:27
【问题描述】:
我尝试使用此tutorial 设置我的 ssh,但无法正常工作,我总是遇到同样的错误。怎么设置?
我有这些钥匙:
user@LAPTOP-LC8KG6GU MINGW64 ~/Documents/programmi_prove/helloworld_project (master)
$ ls -al ~/.ssh
total 32
drwxr-xr-x 1 user 197609 0 giu 17 16:02 ./
drwxr-xr-x 1 user 197609 0 giu 17 17:13 ../
-rw-r--r-- 1 user 197609 3389 giu 17 23:12 id_rsa
-rw-r--r-- 1 user 197609 748 giu 17 23:12 id_rsa.pub
这些是我的错误:
user@LAPTOP-LC8KG6GU MINGW64 ~/Documents/programmi_prove/helloworld_project (master)
$ git remote add origin https://github.com/speranza493/firstapp.git
fatal: remote origin already exists.
user@LAPTOP-LC8KG6GU MINGW64 ~/Documents/programmi_prove/helloworld_project (master)
$ git remote add origin https://github.com/speranza493/firstapp.git/
fatal: remote origin already exists.
user@LAPTOP-LC8KG6GU MINGW64 ~/Documents/programmi_prove/helloworld_project (master)
$ git push -u origin master
remote: Repository not found.
fatal: repository 'https://github.com/speranza493/firstapp.git/' not found
【问题讨论】:
-
git remote -v的输出是什么? -
这是“git remote -v”的输出: * origin github.com/speranza493/firstapp.git (fetch) * origin github.com/speranza493/firstapp.git (push)
-
试试这个
git branch --set-upstream <remote-branch>,然后git push,你得到了什么?我注意到的一件事是,在您的远程网址末尾有一个额外的/,..... firstapp.git/确保您指向正确的网址 -
@WilliamKinaan 与“git branch --set-upstream-to github.com/speranza493/firstapp.git”,我有这个:错误:请求的上游分支'github.com/speranza493/firstapp.git'不存在提示:提示:如果你正在计划将您的工作基于上游提示:远程已经存在的分支,您可能需要提示:运行“git fetch”来检索它。提示:提示:如果您计划推出一个新的本地分支,提示:将跟踪其远程副本,您可能需要使用提示:“git push -u”在您推送时设置上游配置。
-
您执行了错误的命令。假设您在
master分支请尝试git branch --set-upstream origin master
标签: windows git github ssh key