A book of spells for the discerning techcubus
Create or find a key
$ ssh-keygen -t ed25519 -C "your_email@example.com"
$ eval $(ssh-agent -D)
# Yes, ssh-agent actually returns environment variables that we want to eval
$ ssh-add ~/.ssh/id_ed25519
Add public key to github if necessary under authentication
Check remote from the repo directory
$ git remote -V
Fix if necessary
$ git remote set-url origin git@github.com:USERNAME/REPOSITORY-NAME.git
Also test connection
$ ssh -T git@github.com
$ echo "# My New RepoName" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git branch -M main
$ git remote add origin https://github.com/techcubus/RepoName.git
$ git push -u origin main
…or link & push an existing repository
$ git remote add origin https://github.com/techcubus/RepoName.git
$ git branch -M main
$ git push -u origin main
On Windows, running in PowerShell, for me this appeared to hang git without an error as a dialog to pick the authentication method had opened behind other windows.