GIT Error Fatal: remote origin already exists (and how to fix it quickly!)
Welcome to the ultimate tutorial on how to fix remote origin already exists error! In this quick git tutorial I’ll show you the command you can execute for fixing this error quickly!
Oct 15, 2022
So this error happens when you’ve already linked your local repo to a remote URL on github. Now you want to change it so you can start committing elsewhere right? (Or original remote changed location.)
So you ran this command.
git remote add origin https://github.com/username/project.git
But you received the git error fatal remote origin already exists error
Right? Well…………………………………………………..right?
Is that really what happened?…………Be honest.
So what is the solution?
Instead of add
, use set-url
:
git remote set-url origin https://github.com/username/project.git
And this should fix remote origin already exists error.