1

I was trying to add a remote repository and assign it to origin but got this error: fatal: remote origin already exists. then I checked all the remote repositories by remote -v and here is the result:

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)

It seems origin is not assigned to any repository and yet it can't be assigned, renamed or deleted. I know this problem is mentioned here but none of the methods works for me.

EDITED: here is my /.git/config content:

[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/*
Community
  • 1
  • 1
Yar
  • 7,020
  • 11
  • 49
  • 69
  • 2
    Do you mean that `git remote set-url origin ` does not work? What error(s) if any occur? What are the contents of `.git/config`? – torek Aug 02 '14 at 19:14
  • `git remote add github ` and got that error – Yar Aug 02 '14 at 19:33
  • Curious; those contents indicate you should have two `remote`s, `android` and `upstream`, and no `origin`. Perhaps a broken version of git? – torek Aug 02 '14 at 19:38
  • Do you have something named `origin` in your `.git/refs/remotes/` folder? Does `git branch -r` show you anything of `origin`? – Kissaki Aug 02 '14 at 19:45
  • @Aaron Please don't post your .git/config as a comment. Edit your question instead – hek2mgl Aug 02 '14 at 19:47
  • @Kissaki no, dont have that folder and didn't show anything – Yar Aug 02 '14 at 19:57
  • At this point I’d just clone the repository again. If you don’t want to lose history from your current clone, you can add that one as a remote as well and pull any changes you have there. – Kissaki Aug 02 '14 at 20:11
  • @Kissaki yep I guess that's the only option I have. Thanks – Yar Aug 02 '14 at 20:14

0 Answers0