Purpose
These instructions describe the process for setting up GH commands on gadi. These commands make it easier to interface with githib but an initial setup is required.
Prerequisites
- a githib account
- a login to gadi
-
- You need to have an NCI account and to join project vk83.
gh commands
gh
is included in payu
modules supported by ACCESS-NRI. As long as the payu
command is available gh
should be also.
This is how you make the payu
command available:
module use /g/data/vk83/modules
module load payu
Setup
gh auth login
This will prompt for a series of responses. Select the responses used below:
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: XXXX-XXXX
Press Enter to open github.com in your browser...
At this point you will get an error opening a browser on gadi
:
! Failed opening a web browser at https://github.com/login/device
exec: "xdg-open,x-www-browser,www-browser,wslview": executable file not found in $PATH
Please try entering the URL in your browser manually
So open Sign in to GitHub · GitHub in your browser, authenticate with GitHub if you’re not already logged in, copy the one-time code from your terminal window and paste it in. Scroll down the page and click “authorise”. Then authentication should complete:
âś“ Authentication complete.
- gh config set -h github.com git_protocol https
âś“ Configured git protocol
! Authentication credentials saved in plain text
âś“ Logged in as xxxxxxxxxxx
To check status use gh auth status
$ gh auth status
github.com
âś“ Logged in to github.com account xxxxxxxxx (/home/XXX/xxxXXX/.config/gh/hosts.yml)
- Active account: true
- Git operations protocol: https
- Token: gho_************************************
- Token scopes: 'gist', 'read:org', 'repo'