ProjectStack
git

fatal: remote origin already exists

You tried to add a remote named 'origin' but one is already configured. Each remote name must be unique within a repository.

Common causes

  • You ran git remote add origin twice
  • The remote was set when you cloned the repo and you're trying to add it again
  • You're trying to point origin to a different URL than the one already set
  • A previous setup script already configured the remote

How to fix it

  1. Check what remotes are already set: git remote -v
  2. Update the existing origin URL instead: git remote set-url origin <new-url>
  3. Remove the old remote first then re-add: git remote remove origin && git remote add origin <url>
  4. Use a different name if you need a second remote: git remote add upstream <url>

Example

fatal: remote origin already exists.

Running git remote add origin after the remote was already set

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.