I received an email saying GitHub will require token authentication after August 13 2021. I want to ensure I don't have an interruption of service (push/pull) after this date. So I logged into GitHub and created a token for my single repository.

Now I want to use the token to push/pull my repository from GitHub, in Visual Studio Code, which uses Git and the command line, which I have installed on my Mac.

What do I do to add/replace the password from GitHub with the generated token I just created to push/pull from my repository? Can I do it from Visual Studio Code or does it get added from the terminal command line?

If you get a message like this using the GitHub extension by KnisterPeter:

To enable the Visual Studio Code GitHub Support, please set a Personal Access Token

Enable Visual Studio Code GitHub Support

  1. Go to SettingsDeveloper SettingsPersonal Access Token

    Or go directly to https://github.com/settings/tokens

  2. Click Generate New Token

    Settings -> Generate New Token

  3. Go back to Visual Studio Code and open the Command Palette (<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd>)

  4. Type in GitHub: Set Personal Access Token

    Set Personal Access Token

  5. Paste in the value from your newly generated token