我刚刚在Git.我试图创建我的第一个回购和推送项目.
我正在逐步创建一个创建回购.
但在我尝试将我的项目推向空仓后,我接下来抓到了:
致命的:远程起源已经存在
这是我的步骤:
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:nazar-art/NewYearGift.git
git push -u origin master
Run Code Online (Sandbox Code Playgroud)
而在这里我抓住了这个fatal.
我试着git remote -v看远程回购的内容.结果如下:
origin https://github.com/nazar-art/NewYearGift.git (fetch)
origin https://github.com/nazar-art/NewYearGift.git (push)
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚我做错了什么以及如何解决这个问题?
Far*_*hin 16
似乎远程起源已经存在,并且您想要将其uri更改为另一个值.您不能添加原点,因为它已经存在,但您可以更新它.git remote add您可以运行以下命令而不是命令:
git remote set-url origin git@github.com:nazar-art/NewYearGift.git
Run Code Online (Sandbox Code Playgroud)