GitHub Authentication

You must authenticate with your local system to work with GitHub. GitHub removed the password authentication for local repository access in 2021. Here are the 3 ways to authenticate:

gh auth command

Authenticating via gh

To set up cached authentication:

The command will ask a series of questions. Here are the default answers that you can use the enter key for each:

You will then see something like the following instructions:

If you are in WSL, it most likely cannot open the browser. If that is the case, go to the following URL [https://github.com/login/device] in any browser, even on another machine. Log into your GitHub account in the browser. Then enter the one-time code.

You now have authenticated to GitHub and should be able to use git without re-entering your username and personal access token.

Personal Access Token

You can clone a repository from GitHub using a URL. This requires a username and a personal access token. The token is created at GitHub with selected permissions, and the same token can be used to clone on multiple local installations.

If you want to do this, find instructions online, as I discourage this approach. Use gh auth command instead.