github: migrating remote from the old https to ssh

Github no longer allows HTTPS access to the repositories. SSH has been the new style since August last year.

remote: Support for password authentication was removed on August 13, 2021.

I have had an old repo which I had left since two years ago when HTTPS was still the norm there. As now I need to continue some more work on it, the usual git push ritual is no longer working as the remote was still on the HTTPS password authentication.

The way we change it so that remote points to SSH session is:

$ git remote remove origin
$ git remote add origin git@github.com:username/repo.git
$ git push --set-upstream origin main

Make sure your SSH public key is already registered up there in the cloud :)

1 rants:

dormadum said...

hi, i stumbled across your blog and have enjoyed reading them. Do you have a Discord account? I'd like to be able to talk and share things with you (in case you do). Even if you don't its fine! I'll still enjoy reading your blogs once in a while