My original answer was:
For me the fix was:
git remote set-url origin https://some_url/some_repo
Then:
git push
A better answer is:
Looking back at this answer a while later, and as @stevendesu correctly points out in the comment, the better way would be:
Remove the old origin
reference:
git remote remove origin
Add a new origin
reference:
git remote add origin https://some_url/some_repo
Verify this worked with:
git remote -v
And/or:
git remote show origin
Also note that you can add multiple origins, for instance, you can leave the origin
remote intact, and add one called with another name, for instance, secondary_repo
, with:
git remote add secondary_repo https://some_url/some_repo
You will now see multiple repos with git remote -v
, something like:
origin https://some_url/some_origin_repo (fetch)
origin https://some_url/some_origin_repo (push)
secondary_repo https://some_url/some_repo (fetch)
secondary_repo https://some_url/some_repo (push)
However, make sure you always specify which repo name your pulling from/pushing to, like so:
git push origin
or:
git push secondary_repo
Also see the docs for more details.