[英]Github error “fatal: remote origin already exists.”
我正在尝试遵循Bottega教程,但遇到了此错误。 我看过其他类似的问题,但似乎没有答案对我有用。 我正在使用Rails 5,但是当我尝试以下行时,它给了我错误
git remote add origin https://github.com/MyName/my_view_tool.git
我想知道是否有人新来解决此问题? 我看到的常见答案之一是以下内容,但它对我不起作用。
git remote set-url origin git@github.com:MyName/my_view_tool.git
您已经添加了一个远程命名origin
,在项目根路径中找到.git
文件夹,然后在.git
文件夹中编辑config
文件,将.git
url替换为GitHub url,如下配置文件:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = [ORIGIN_URL_HERE]
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
在您喜欢的编辑器中打开.git/config
并手动更改远程存储库的URL,该存储库位于[remote "origin"]
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.