我正在尝试添加远程存储库并将其分配给origin
,但出现此错误:
fatal: remote origin already exists.
然后我按remote -v
检查了所有远程存储库,结果如下:
android https://github.com/hooman-y/cw-omnibus.git (fetch)
android https://github.com/hooman-y/cw-omnibus.git (push)
origin
upstream https://github.com/commonsguy/cw-omnibus.git (fetch)
upstream https://github.com/commonsguy/cw-omnibus.git (push)
似乎origin
未分配给任何存储库,但无法分配,重命名或删除它。我知道这个问题被提到here,但没有一种方法适合我。
EDITED:
这是我的/.git/config
内容:
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
hideDotFiles = dotGitOnly
[branch "master"]
[remote "android"]
url = https://github.com/hooman-y/cw-omnibus.git
fetch = +refs/heads/*:refs/remotes/android/*
[remote "upstream"]
url = https://github.com/commonsguy/cw-omnibus.git
fetch = +refs/heads/*:refs/remotes/upstream/*
答案 0 :(得分:-1)
当我完成命令时,这也发生在我身上:
git remote add origin git://github.com:ricardooo/prj1
git remote add origin git://github.com:ricardooo/prj1
fatal: remote origin already exists.
他们建议删除链接并再次使用您想要的内容重新链接。
或许看看:Remote origin already exists on git push to new repository 它对我帮助很大。