Setting up your Personal Access Token
Please follow the instructions under the heading ‘Creating a personal access token (classic)’ to create a Personal Access Token. Generally, you need to have at least the “repo” permissions toggled ON for the token to provide read/write access to the repositories you typically have access to. NOTE: the Personal Access Token is only available for copying until you close the page. Once you close the page, GitHub will not show you that token again and you’ll have to generate a new token if you forget/lose it.
Follow those instructions, then do the following on all machines you use git on. This command will configure git to look at your ~/.git-credentials file for your GitHub credentials.
git config --global credential.helper 'store'- Then open/create
~/.git-credentialswith nano and add the following line, where<GITHUB_USERNAME>is your GitHub username and<PASTE_TOKEN_HERE>is the Token you copied from the GitHub page.
https://<GITHUB_USERNAME>:<PASTE_TOKEN_HERE>@github.comSave the file and you should be able to do all of your command-line git operations as usual (and without entering your username and password every time).
Please keep in mind that this is effectively a password to your account (although only for whatever you grant it the authority to do), so treat it like you’d treat any of your other passwords (don’t paste it into Slack, email, etc.)