Have you ever encountered this error: remote origin already exists when wanting to add one? Let’s see how to solve that.

There is two way to do that.

Removing and adding

First, remove the origin from your repo:

git remote remove origin

Then try again the command that was throwing you an error before:

git remote add origin git://yourlink.com/

Updating

There is a way to directly update the remote origin by using this command:

git remote set-url origin git://yourlink.com/

Share


The Hot Code
© 2025, All Rights Reserved.

Quick Links

Social Media