Thanks @clairecarouge! @Jhan if you are happy to run the above command that would be great, as I’m having difficulty accessing the copied directories.
Longer term, Claire mentioned that it would be a better option for everyone to share payu configurations by pushing them to personal repositories on github. There are instructions for this in the Training Day payu tutorial, which I’ll copy the relevant parts from below:
(I’ve modified the instructions to use SSH rather than https)
Authorise with GitHub
gh
is included in payu
modules supported by ACCESS-NRI. As long as the payu
command is available gh
should be also.
The first step is to authorise with GitHub:
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? SSH
? Upload your SSH public key to your GitHub account? Skip
? 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 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. Then authentication should complete:
✓ Authentication complete.
- gh config set -h github.com git_protocol ssh
✓ 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'
Push to repo
Next navigate to the payu control directory that you will be sharing, and make sure to commit any changes that you have made.
Now you can create a repository from your control directory using
gh repo create
Follow the prompts and enter the information requested. Repository name will default to the directory name of your control directory. The repository owner should be your GitHub username used to authenticate. Choose public visibility. The remote name is just an alias to your repository that git uses when doing a push
or pull
.
? What would you like to do? Push an existing local repository to GitHub
? Path to local repository .
? Repository name XXXXX
? Repository owner xxxxxxxxx
? Description A nice description of the purpose of the repository
? Visibility Public
✓ Created repository xxxxxxxxx/XXXXX on GitHub
https://github.com/xxxxxxxxx/XXXXX
? Add a remote? Yes
? What should the new remote be called? myrepo
✓ Added remote git@github.com:xxxxxxxxx/XXXXX.git
? Would you like to push commits from the current branch to "myrepo"? Yes
This will create a personal repository containing the configuration on github that can then be shared. Let me know if you have any questions!
Thanks,
Spencer