-1

I am trying to add a file to my first github.com repository. I misspelled my username in the "git remote add origin" command. If I try and do it again correctly, it gives me an error:

fatal: remote origin already exists.

How to I clear the value so I can correct it? Or, how to I change what is there?

Scooter
  • 6,802
  • 8
  • 41
  • 64
  • 1
    Does `git remote rm origin` and then re-adding it correctly help? – meilke Oct 21 '17 at 07:11
  • @meilke Yes, that worked. – Scooter Oct 21 '17 at 07:43
  • Possible duplicate of [Remote origin already exists on 'git push' to a new repository](https://stackoverflow.com/questions/1221840/remote-origin-already-exists-on-git-push-to-a-new-repository) – phd Oct 21 '17 at 12:20
  • Possible duplicate of [how to remove remote origin from git repo](https://stackoverflow.com/questions/16330404/how-to-remove-remote-origin-from-git-repo) – 1615903 Oct 23 '17 at 07:22

1 Answers1

2

Use git remote set-url to update remote url

git remote set-url origin git://newurl
Shashwat Kumar
  • 5,159
  • 2
  • 30
  • 66
  • It worked but I don't understand the "git://newurl". I did "git://https..." and got an error, so left off the "git:" and it worked. – Scooter Oct 21 '17 at 07:42