Coding⏱️ 2 min read📅 2026-05-30

How to Fix: GitHub "fatal: remote origin already exists"

Git error when adding remote origin to GitHub repository.

Quick Answer: Try removing the existing remote origin by running `git remote rm origin` before attempting to add a new one.

The 'fatal: remote origin already exists' error occurs when you try to add a new remote repository that has the same name as an existing one. This could be due to multiple instances of the same repository on GitHub or because you've previously tried to clone or push to this repository and then later decided to create a new branch.

🔧 Proven Troubleshooting Steps

  • Try deleting the existing remote repository by running `git remote rm origin` in your terminal.

Method 1: Delete Existing Remote

  1. Step 1: Run `git remote rm origin` in your terminal to delete the existing remote repository.

Method 2: Clone Repository Again

  1. Step 1: Run `git clone git@github.com:ppreyer/first_app.git` to clone the repository again, overwriting the existing one.

✨ Wrapping Up

By following these steps, you should be able to resolve the 'fatal: remote origin already exists' error and successfully add your repository to GitHub.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions