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:
git remote add githuborigin https://github.com/wullemsb/Extensions.Caching.PostgreSQL.git
Now I can push my code to this remote using git push -u githuborigin master
Remove the existing remove first and retry the original command afterwards
git remote rm origin