gh - adcroft/MOM6 GitHub Wiki

Install gh (the GitHub command line tool), e.g.:

sudo install gh

Use gh to authenticate via a PAT (personal access token):

gh auth login

Select "GitHub.com", "HTTPS", "Paste an authentication token". For the last step you will now need to create a PAT.

To create a PAT:

  • Goto https://github.com/ (make sure you are logged in)
  • Pull down the menu for your account and select "Settings"
  • Click "<> Developer Settings" at the bottom of the left column.
  • Click "Personal Access Tokens" in the left column.
  • Click "Generate New Token"
  • Give the token a meaningful note, such as the name of the machine you are accessing from.
  • Check "repro" and "read:org"
  • Click "Generate Token" (bottom of form)
  • Copy the token from the web page, and paste it to the terminal where you have the gh prompt for the authentication token.

Configure git to use credential caching (following https://github.com/NOAA-GFDL/MOM6-examples/wiki/Git-configuration-and-environment):

git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'