Appendix A — Setting a PAT

This section contains instructions for creating a Personal Access Token (PAT) directly on GitHub and the terminal. If you prefer setting the PAT through RStudio, please refer to the MEDS Installation guide.

A.1 Context

The context for these instructions is the following: in the terminal, you try to push new changes to your upstream repository and it asks for your Git credentials. Cancel that command by pressing Ctrl + C and start in a new line of the terminal.

A.2 Instructions

  1. To store the PAT once it’s created, first run this command on the terminal:
git config --global credential.helper 'cache --timeout=10000000'
  1. In GitHub navigate to:
  • settings
  • developer settings (last option on the left)
  • tokens (classic)
  • generate new token button (near right corner)
  • Click on: Generate new token (classic)
  1. Select the following options:
  • ☑️ Repo (clicking this will select all boxes in the section, that’s ok)
  • ☑️ workflow
  • ☑️ gist
  • ☑️ user (clicking this will select all boxes in the section, that’s ok)
  1. Click generate token.

  2. Copy and paste the PAT somewhere for now!

  3. Back at the terminal try to push your changes again using git push. When prompted, enter your GitHub username and the new PAT as the password.

Note

In steps 1-5 we generated a PAT manually. This is the same process as using usethis::create_github_token from an R console as explained in the MEDS installation guide. The options we selected in step 2 are the same options for the PAT given by usethis::create_github_token.