Git: changing repositories from https to ssh.15 Jan 2022
I’ve had to change a lot of repositories to use ssh (instead of https), and I always forget how to do it.
A real, in-depth post is from pandammonium.
What I do – once I remember – is go to the repository in question at GitHub, go to the code button, select ssh, and copy. Then, at the command line in the repo,
git remote set-url origin thing-you-copied-from-github
Then add, commit, push, whatever.