我在GIT和GitHub中是全新的,我在尝试将本地存储库链接到GitHub帐户时遇到了以下问题
我知道:
Andrea@Andrea-PC MINGW64 ~/Documents/WS_vari/version-control/recipes (master)
$ git remote set-url origin https://github.com/AndreaNobili/recipes.git
fatal: No such remote 'origin'其中https://github.com/AndreaNobili/recipes.git是GitHub为这个存储库提供的https链接。
为什么我会得到这个错误信息?什么意思没有如此遥远的“起源”?我怎样才能解决这个问题?
发布于 2016-08-18 09:13:43
您使用的命令不是添加,而是设置现有远程的URL。您要查找的命令是
git remote add origin https://github.com/AndreaNobili/recipes.git如果您想要更改URL或修复错误,可以使用set-url:
# Note the typo in the URL:
git remote add origin https://gmail.com/AndreaNobili/recipes.git
# This command fixes the typo:
git remote set-url origin https://github.com/AndreaNobili/recipes.git发布于 2016-08-18 09:30:31
作为对此的扩展,您可以使用
git remote add --track master origin github.com/AndreaNobili/recipes.git
git remote add --master origin github.com/AndreaNobili/recipes.git这只跟踪主分支。
git remote add --track different-oil origin github.com/AndreaNobili/recipes.git这个跟踪不同的石油分支。
https://stackoverflow.com/questions/39014211
复制相似问题