Skip to content

All: Downloading from GitHub

Paula edited this page Nov 16, 2017 · 1 revision

If you are unfamiliar with using GitHub, follow these instructions to download one of the repositories.

If you are new to Git, please take some time to go through one of the recommended tutorials

Initial setup

If you have not added your SSH key to GitHub, follow these instructions to do this now:

  1. It is easiest to use Git via SSH, which means you need to copy your SSH public key to your GitHub account. First, run ls ~/.ssh and see if you have a file called ~/.ssh/id_rsa.pub. If you do not have this file, go to Step 2. Otherwise, continue to Step 3.

  2. Run

     ssh-keygen
    

    and accept all of the default options (just keep pressing enter), which will create ~/.ssh/id_rsa.pub

  3. Run

     cat ~/.ssh/id_rsa.pub
    

    This will print out your public key to the terminal. It looks like

     ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCnZW+yK2lxkPtn2PJ8bEqCFHfEC
     /s3FcX9/7p8pdO6X/D7oqVLw5WiL0qZqRA+JQi50nVAn7k8veeN0TTpzncyzMtTfYpN
     BCjGME8meS+i2QiN59ENU2f+JJ2v53EKJ2Pkfuo2KtBD2DVq3FWq9iRnYRb/BZi4etYG
     ZMFSL9YYBkkh3pbAhuOVoKlX9fA01/gkHBG/Il9txnFuQBOyM1hZwnUj0EsEdHf51Otyc
     XgKVUDp+1ZfY2Iy86JgOxuL2B8/mszlgdmXdBQVLVPkHqVkCw+Y5mP1xtVPs0ggYrnuw6
     e4TPSjLWAbkcDkN/Twc8cEUlQPKy0RtxDFehB7k1hX [email protected]
    

    Copy this onto your clipboard

  4. Open GitHub in your browser, and click on your portrait photo on the top right corner of the website. Select 'Settings' from the dropdown menu

  5. On the left panel of your settings page, click on 'SSH keys'

  6. In the main panel, click on the button 'Add SSH key' on the right side of the screen

  7. Name your SSH key (whatever you like e.g., Work desktop) and paste the public key into the main text box. Click the 'Add key' button to save your key

Downloading a repository

To clone a Git repository, do the following:

  1. Go to the project page for the Git repository you want access to e.g. https://github.com/BrainDynamicsUSYD/neurofield

  2. In the panel on the right side of the screen, there is a small textbox with a title HTTPS clone URL or SSH clone URL. Underneath the text box, it says 'You can clone with HTTPS, SSH, or Subversion'. Click on 'SSH', and then copy the URL in the textbox. The URL looks like

     [email protected]:BrainDynamicsUSYD/neurofield.git
    
  3. Open a terminal window, and navigate to the folder where you want to download the repository to e.g., your home directory.

  4. Type git clone and then paste the URL into the terminal window. So the complete command to download the NeuroField repository is

     git clone [email protected]:BrainDynamicsUSYD/neurofield.git
    
  5. Git will now download the repository into a new folder called neurofield inside the current directory