Only Bolivian Here
Only Bolivian Here

Reputation: 36763

How do I remove an invalid remote I added in Git?

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?

Upvotes: 15

Views: 14097

Answers (4)

7stud
7stud

Reputation: 48649

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)

Upvotes: 5

knittl
knittl

Reputation: 265807

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

git remote set-url Nakor git://github.com/nakor/CherryTomato.git

Upvotes: 21

johnsyweb
johnsyweb

Reputation: 141928

When all else fails:

git config --edit

Under...

[remote "Nakor"]

...edit the line...

    url = git://github.com.nakor/CherryTomato.git

Upvotes: 9

Marcelo Cantos
Marcelo Cantos

Reputation: 186068

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

Upvotes: 1

Related Questions