Just a quick reminder to myself for next time as to how to set up a fine-grained access token with GitHub.

  1. Log on to GitHub
  2. Go to Settings (under your avatar, upper right corner)
  3. Go to <> Developer settings (lower left)
  4. Click Personal access tokens
  5. Click Fine-grained tokens
  6. Click Generate new token
  7. Set the name, date (max. 1 year from now)
  8. Click Only select repositories and pick the repo
  9. Under repository permissions, pick Commit statuses, Content, Merge queues and Pull requests for read-write; Metadata should be automatically selected for Read access 
  10. Click Generate token
  11. Copy the token, "github_..." and store it somewhere safe

Now, on your own host, from the git command line, you should be able to do the following:

git remote add origin https://[your token here]@github.com/[your username]/[your repo name].git

or, if the remote repo was already configured,

git remote set-url origin https://[your token here]@github.com/[your username]/[your repo name].git

That's it. You're all set, you should be able to do a git push origin master or use tools like Microsoft's Visual Studio Code.