origin was set by git clone or an earlier setup step
CommonThe repository was cloned, or the new-repository instructions were run twice, so origin exists already.
Confirm
git remote -v
An origin line, possibly with a different URL from the one you are adding
Fix
- To change where origin points: git remote set-url origin NEW_URL, then git remote -v to check.
- If origin already has the right URL, skip the add and push: git push -u origin main.
git remote set-url origin NEW_URL && git remote -v
Reproduced on Git 2.50.1.