Tuesday, September 5, 2017

Git: Remote origin already exist

Yesterday when trying to execute the following command in Git

git remote add origin https://github.com/wullemsb/Extensions.Caching.PostgreSQL.git

I got the following error message

fatal: remote origin already exists.

Problem was that my Git repository was already linked to a remote named “origin”. “origin” is just a naming convention used by Git to indicate your ‘master’ repo.

To solve the error you have 2 options:

  • Create a different remote with another name:
  • Remove the existing remove first and retry the original command afterwards
    • git remote rm origin