I'd like to overwrite the origin of my git repo (I moved it from my company account to personal account).
When I do git remote add origin
it complains that the origin already exists
I'd like to overwrite the origin of my git repo (I moved it from my company account to personal account).
When I do git remote add origin
it complains that the origin already exists
You change the location of your remote origin with git remote set-url origin <new-url-here>
More info can be found in the docs here: https://git-scm.com/docs/git-remote#Documentation/git-remote.txt-emset-urlem
You can either change the target URL by doing
git remote set-url origin <new-url>
git remote rm origin
git remote add origin ORIGIN
git config master.remote origin
git config master.merge refs/heads/master
Replace ORIGIN
with your origin
Example
git remote rm origin
git remote add origin git@github.com:tolicodes/infragen.git
git config master.remote origin
git config master.merge refs/heads/master