Git and GitHub¶
Now that we have our own University-wide GitHub repository, there has never been a better time to start using Git and GitHub for any files that require version control. It’s never too early or too late to start applying version control to files and there is no project too big or too small for Git!
This page provides some tips for using Git and GitHub on Artemis. For a full introduction to Git, see the Git user guide.
Load the Git module¶
The first command you should run before using Git on Artemis is:
module load git
This will load Git version 2.8.0. The default verson of Git on Artemis is 1.7.1, which has compatibility issues with Sydney University’s Git repository.
Set up SSH keys between GitHub and Artemis¶
SSH keys between GitHub and Artemis will allow you to push commits to your GitHub account without having to type a password. To set up SSH keys, follow the steps below.
Generate a SSH key pair on Artemis¶
Login to Artemis, then type the following command in your Artemis terminal session:
If you accept the default options, this will generate a public key,
id_rsa.pub and a private key
id_rsa in your
Never share your private key (id_rsa) with anyone. It should permanently stay in your ~/.ssh directory on Artemis. Only share the public key (id_rsa.pub).
Copy the public key¶
The output should look similar, but not identical, to this:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA7Nxs3q+izyn0nT7c/2zb4RPP6pHur5Xh6mFC1fq703e3Cz1yim Q0gaqmZsiwo7aid1HrPdvz/cGdcA7AB+GqtT9Lli3J5so6usFertMMTqsZ4x8xV36sWupTWeJ4PZxU 9OkeID4Qesqz4y65EJSHwTq3FEg/i7JGv7cTIOT123lsNDEIxVubUyK/NqhtuQqLzH7a9XQqiooAUK xw1EkN4GZPh/PC095CYUiOBMEFsAQ6VMgwCcVC1of3g2hRfQOtJ+9+iPgtLDmc9IWTSvNlpajqnZ5J Jmyk7JTEOP6GI6sngVynt8KNuZU6BouVvMpFnYI2cl/S077JlLrTfP1KDQ== abcd1234@login2
We will need this public key for the next step.
Paste the public key into your GitHub allowed SSH keys¶
- Open a web browser and go to github.sydney.edu.au
- Login with your Unikey credentials
- Click the icon in the upper-right hand corner and click settings
- Go to settings, then select SSH and GPG keys menu
- Click “New SSH key” in the upper-right hand corner of the window
- Give the key a name. It can be any name, for example “Bob’s Artemis SSH key”.
- Paste the contents of your Artemis public SSH key into the “key” box.
- Click “Add SSH key”
You should now be able to push and pull changes from your Artemis Git repository using the SSH protocol without typing a password.