We will use the Computer Science Department gitlab site for all lab and project distributions. Access to this site is via https://coursework.cs.duke.edu/ which you may have accessed before if you used it for Compsci 201. You will be added to a group for Compsci 210 specific to this semester and you have to configure your container to use git for this class.
We are using things similar to how you used them in Compsci 201. You will fork labs and projects and submit using gitlab integration with Gradescope. If you are not familiar with git, please let us know so that we can assist in helping you learn.
You should commit and push your code to gitlab frequently since it can serve as a good backup of your work in the event your container fails. Recall, the OIT containers are not backed up and if you are using a local container it will depend on your own backup process. Git is the recommended method in this class for ensuring your efforts are backed up and you are expected to use that.
You will need to use SSH for gitlab access (clone, add, commit, push, etc.). If you are using the OIT containers follow the steps below. If you are running a local container you have two options: 1) follow the steps below or 2) use git in a terminal on your local machine.
These steps are described here at this link in Section 2 for creating an SSH key-pair.
ssh into your container, this gives you a terminal on your container
Create a new key pair on your remote system in the same way we created a key prevously.
Copy this key to your GitLab account.
Sign in to GitLab.
On the top bar, in the top right corner, select your avatar.
Select Preferences.
On the left sidebar, select SSH Keys.
Type cat ~/.ssh/id_rsa.pub in a terminal on your container
Select the output of that, it is generally one line that starts with ssh-rsa. Be careful if there is any line wrap, the key needs to be a single line.
In the Key box, paste the contents of your public key (usually located in the file ~/.ssh/id_rsa.pub)
In the Title box, type a description, like Work Laptop or Home Workstation.
Select Add key.
Once you have completed the above you should be able to clone the first lab to your container.
For those running a container on your local machine, you can use your local host (MacOS or Windows) to run git avoiding the need to generate keys on your containers. This will introduce a bit of complexity in your workflow since you will run git in a local terminal but you need to do all compilation and running of the labs and projects in terminal on your local container. It's easy to forget and try to run git in the container.
Recall that a local container shares a directory with your local machine. So by changing directory (cd) into that shared directory on your local machine you can create files, and run git that are accessible from the container. Likewise, files you edit and create in the container are accessible from the local machine. The model is to do development in the container and use git from your local machine. You may find it easier to just add ssh keys to the container and do all work within the container.
If you have previously setup your local machine with ssh keys to access coursework.cs.duke.edu gitlab instance you are good to go. If you have not previously setup ssh keys for the CS gitlab instance, then you need to following the instructions above but replace step 1 with open a terminal on your local machine.