You may need to change a GitHub origin definition in the client-side, some reasons to do this are:
- the repo name changed;
- you want to switch from HTTPS to SSH or vice-versa.
Imagine I want to change my authentication method from HTTPS to SSH, the HHTPS URL I want to replace is:
https://github.com/sparkfireworks/spark-fireworks.git
the SSH URL want to start using is:
git@github.com:sparkfireworks/spark-fireworks.git
Start by listing current origin:
$ git remote -v
origin https://github.com/sparkfireworks/spark-fireworks.git (fetch)
origin https://github.com/sparkfireworks/spark-fireworks.git (push)
Now remove the origin no longer in use:
$ git remote remove origin
Finally add the new SSH URL:
git remote add origin git@github.com:sparkfireworks/spark-fireworks.git
Now check you successfully switched to SSH:
$ git remote -v
origin git@github.com:sparkfireworks/spark-fireworks.git (fetch)
origin git@github.com:sparkfireworks/spark-fireworks.git (push)