dev@local: ~/project — git
dev@local~/project$git remote add origin <url>
fatal: remote origin already exists
Diagnostics Translation
You tried to add a remote named 'origin', but one with that name already exists.
waiting for resolution...
LowVersion Control System

Reviewed for reference consistency: April 11, 2026

Code is Safe

SECURE

Git has paused the operation to protect your code. No data has been lost or corrupted.

What To Know

This usually means the repository already has remote wiring for its primary server alias, so Git is protecting the existing mapping from silent replacement.

Where Did It Fail?

Working Tree
Your local files
add
Staging Index
Prepared changes
commit
Local Repo
Commit history
push/fetch
Remote Server
GitHub/GitLab
The error occurred during a network exchange. Your local files are untouched, but Git cannot reach the remote server.

Commands That Trigger This

$git remote add origin <url>
Following an online tutorial that says to run inside a repo that was already cloned
$Trying to link an existing project to a second remote repository using the same default name
Trying to link an existing project to a second remote repository using the same default name

Technical Background

01

Git remote names are just aliases for URLs. If 'origin' is taken, you can either change the URL associated with 'origin', or add the new URL under a different name (like 'upstream').

02

This error is purely a configuration safeguard and does not affect your local commit history.

Underlying Causes

Running `git remote add origin` twice
Cloning a repository (which creates 'origin' automatically) and then trying to add 'origin' manually
Attempting to change the origin URL using 'add' instead of 'set-url'

Frequently Asked Questions

It implies the repository already has a stored remote mapping named origin, so Git is preserving an existing server alias rather than silently replacing it.

Related Git States