You ran git remote add origin and Git refused. Your repo already has a remote named origin. You do not need to add it again. You need to look at it, then change it or leave it.
git remote -v lists every remote and its URL. If origin already points where you want, you are done.
git remote set-url origin NEW-URL changes where origin points. This is the usual fix.
git remote remove origin, then run your git remote add origin URL again. The git remote rm spelling does the same.
Removing a remote only deletes the link in your local repository. It does not delete anything on GitHub.
you@laptop my-project % git remote add origin https://github.com/octocat/Spoon-Knife.git
fatal: remote origin already exists.
This is the message as shown in the GitHub Docs page on managing remotes. A remote name can only exist once per repository, so Git will not overwrite it for you.
git remote set-url origin https://github.com/OWNER/REPOSITORY.gitgit remote add upstream URLupstream is the usual choice for the original repo of a fork.git remote rename origin old-origingit remote remove originRun git remote -v before you change anything, and again after. Each remote shows once for fetch and once for push. After set-url both lines show the new address. Then git push -u origin main pushes to the new place, using whichever branch name you have.
fatal: not a git repository (or any of the parent directories): .gitYou are not inside a repositorySee the fix for this error.Your repository already has a remote named origin, often from git clone, which sets it up for you. Names are unique, so git remote add origin fails.
Run git remote set-url origin NEW-URL, then check it with git remote -v.
No. It only removes the link from your local repository. The repository on GitHub is untouched.
Give the second one a different name, for example git remote add upstream URL. Each remote name can exist once.