Thursday, February 6, 2025

Git Manual

 For multiple git accounts on a single machine simply set the remote path that includes the username using https rather than ssh. that is:

git remote set-url origin https://USERNAME@github.com/USERNAME/PROJECTNAME.git

and you are good to go:

git push

When you first enter your password, you will probably see this message:

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

You must use a Github PAT to do HTTPS pushes on github.com

Your PAT will look like a 40 character letter/number hash, like

zIa03uTnN0TTaReAALT09K33NMBbCfum6lw8TDSb

When you push using this method, you will be presented with a dialog box when you push:

Github enter password PAT dialog on Windows 10

To ensure that the commits appear as performed by USERNAME, one can setup the user.name and user.email for this project, too:

git config user.name USERNAME
git config user.email USERNAME@example.com