Cloning Your Repository
If you want to work directly on SoCS Linux machines or your own PC, you will need to set up an SSH key, authorize access to the GitHub organization containing your repository, and then clone that repository to your SoCS filestore or your PC’s hard disk.
Installing Git
On your own PC, check if you have Git installed and set up correctly by entering
git
at a command line prompt. If you get a ‘command not found’ error then you’ll probably need to install it yourself:
-
If you are running Linux, you can do this using your distribution’s package manager.
-
If you have a Mac, you can install Git as part of the Xcode command line tools.
-
If you are running Windows, then you should install the Git for Windows distribution. (Note that we recommend the use of Linux or Mac rather than Windows, if possible.)
Setting up an SSH Key
You may have done this last year for COMP1850—in which case you can skip this step and go straight to ‘Authorizing and Cloning’ below.
-
In a terminal window1, create an SSH key pair with a command like this:
ssh-keygen -t ed25519 -C "USERNAME@leeds.ac.uk"Be sure to substitute your University of Leeds username for
USERNAMEhere! -
Start the SSH agent if necessary:
eval "$(ssh-agent -s)"Then add your SSH key pair to it:
ssh-add ~/.ssh/id_ed25519 -
Display the public key in the terminal, with
cat ~/.ssh/id_ed25519.pubCopy everything that was displayed by this command to the clipboard.
-
In your browser, go to github.com and login if necessary, then click on your profile icon at the top-right of the page and choose Settings > SSH and GPG Keys. Then click on the green New SSH key button.
Paste the contents of the clipboard into the space provided. Give the key a recognizable title that identifies the environment you are using (e.g.,
My LaptoporSchool of Computer Science), then click Save.
See the GitHub guides to connecting using SSH keys and troubleshooting common problems if you need more help with this.
Authorizing and Cloning
Note: you should ignore steps 1 & 2 below if you are working in a fork of
the comp2850-oop-work repository.
-
In your browser, go to github.com, click on your profile icon at the top-right of the page and choose Settings > SSH and GPG Keys.
-
Click on the Configure SSO drop-down menu that appears next to your SSH key. Select ‘COMP2850-2526’ from list of options and click on the Authorize button. Use your University of Leeds credentials to authorize single sign-on access to the repository.
-
Go to your repository’s home page on github.com. Click on the green Code button, select the ‘Local’ tab and choose SSH as the Clone option. Copy the repository URL to the clipboard.
-
In a terminal window on a SoCS Linux PC or your own PC navigate to where you want to clone the repository. Type
git clone, then paste in the repository URL that you copied in the previous step. End the command with the name you want to use for the directory that contains the repository, then press Enter.
-
If you are using Windows, this terminal should be the ‘Git Bash’ terminal provided by the Git for Windows distribution. ↩