我正在以下本地仓库中进行操作;还清除远程存储库(即来源):
git init
然后在下面,如果不存在,将创建“起源”:
git remote add origin [repo-url]
否则,您可以使用set-url子命令来编辑现有的遥控器:
git remote set-url origin [repo-url]
此外,您可以使用来检查现有的遥控器
git remote -v
答案 0 :(得分:3)
git remote add <name> <url>
的文档状态
为
<name>
处的存储库添加名为<url>
的远程服务器。
和git remote set-url <name> <newurl> [<oldurl>]
更改遥控器的URL。将与正则表达式
<name>
匹配的远程<oldurl>
的第一个URL(如果没有给出<oldurl>
的话则设置为第一个URL)为<newurl>
。
如果要添加远程URL,请使用git remote add <name> <url>
进行简化,如果要更新现有的远程名称,请使用git remote set-url <name> <newurl> [<oldurl>]
。