The authentication on GitHub using automatically generated tokens and saved in Windows Credential Manager works like a charm. For as long as you need to access only one GitHub account. For the time being the workaround for another account is to authenticate with an ssh key.
Using OpenSSH in the first step could have saved me a lot of time, but I made a bigger loop via PuTTYen. Generated an RSA 2048 bit key and exported to all formats supported by the tool:
Unfortunately, the simplest approach via TortoiseGit did not work:
Ending with the response:
> git push -u origin main email@example.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
It turned out, git did not look for the configured key at all. The following helped:
A few good-to-know things:
ssh-keygen -e -f ~/.ssh/id_rsa > PATH_TO_RFC4716_PUBLIC_KEY
Export RFC4716 public key to OpenSSH format:
ssh-keygen -i -f PATH_TO_RFC4716_PUBLIC_KEY > ~/.ssh/id_rsa.pub
GitHub awaits the username “git” for the SSH protocol, not the one of your account.