13

Here's the line I fired:

git remote add Nakor git://github.com.nakor/CherryTomato.git

I made a mistake and the command should have been:

git remote add Nakor git://github.com/nakor/CherryTomato.git

When I try to run the second command, I get this error:

fatal: Remote Nakor already exists.

Which is understandable. How can I edit the endpoint the remote Nakor is pointing to?

Only Bolivian Here
  • 32,571
  • 60
  • 151
  • 250

4 Answers4

19

you can use the set-url subcommand of git remote:

git remote set-url Nakor git://github.com/nakor/CherryTomato.git
knittl
  • 197,664
  • 43
  • 269
  • 318
9

When all else fails:

git config --edit

Under...

[remote "Nakor"]

...edit the line...

    url = git://github.com.nakor/CherryTomato.git
Johnsyweb
  • 121,480
  • 23
  • 172
  • 229
  • It opens up a Vim terminal, so now I have **two** problems. :D Any way to edit this on a normal text editor? I'm on Windows 7. – Only Bolivian Here Apr 20 '11 at 13:47
  • 1
    I'm sorry to hear that (Windows). See [this question](http://stackoverflow.com/q/10564/78845) on how to configure your editor on Windows. – Johnsyweb Apr 20 '11 at 13:51
  • P.S: Vim is a [normal](http://vimdoc.sourceforge.net/htmldoc/various.html#:normal) text editor... you should give it a try sometime! – Johnsyweb Apr 20 '11 at 22:01
  • I would hardly call Vim a normal text editor (in regular English sense). Also, I use Emacs. :) – Only Bolivian Here Apr 21 '11 at 00:18
3

From github help Removing a remote:

git remote -v
# View current remotes
origin  https://github.com/OWNER/REPOSITORY.git (fetch)
origin  https://github.com/OWNER/REPOSITORY.git (push)
destination  https://github.com/FORKER/REPOSITORY.git (fetch)
destination  https://github.com/FORKER/REPOSITORY.git (push)

git remote rm destination
# Remove remote
git remote -v
# Verify it's gone
origin  https://github.com/OWNER/REPOSITORY.git (fetch)
origin  https://github.com/OWNER/REPOSITORY.git (push)
7stud
  • 42,113
  • 12
  • 85
  • 111
1

git remote --help tells all. In this instance, use git remote set-url ....

Marcelo Cantos
  • 167,268
  • 37
  • 309
  • 353