GitLab Setup for CS 471/571 Projects

Introduction

The following instructions describe how to create a Git source code repository in the student computing environment at GMU.

We will be using Mason CEC GitLab for all our OS/161 kernel hacking projects.

These instructions assume that you have already followed the step of OS/161 installation (obtaining OS/161 source code) following Step-5 of Assignment-0 (PA-0), and that you have not yet configure and build the kernel. This is because we want to create a Git repository that contains the OS/161 source code, but not all of the other junk that gets created when you configure and build.

Step 1: Create a GitLab Repo

First, you will need to login to GitLab by clicking Sign in with: GMU SSO. Note: VPN is needed if you access from off-campus.

Important: Make sure you create a Private project with the name os161-1.11, and use Git to keep track of your code editing history.

When creating a new project, you can directly set the visibility to Private upfront. This is important because sharing your os161 source code in a public repository would be considered honor code violation.

Step 2: Clone Your GitLab Repo

Before cloning your GitLab repo to the student computing environment, you will need to first create an RSA SSH key by typing:

% ssh-keygen -t rsa -b 2048 -C "your_email_addr"

Or you can simply follow this tutorial.

Then, add an SSH key to your GitLab account by following these instructions.

Test if the SSH-based access has been successfully set.

Note: you should replace git@gitlab.example.com in that command sequence with git@git.cec.gmu.edu

Click on the Clone button at the right-top corner of your GitLab repo’s webpage, copy the string under Clone with SSH to clipboard. Then, create a new directory called os161 under your $HOME directory, cd to your working directory where you are supposed to put your os161 source code, and clone your created GitLab repo on to your student.cs (Zeus) Linux box:

% mkdir ~/os161 
% cd ~/os161 
% git clone git@git.cec.gmu.edu:your_gid/os161-1.11.git

You can then copy the downloaded os161 src into this newly created git directory:

% cd ~/os161/os161-1.11
% cp -r ~/tmp/os161-1.11/* .

Step 3: Check in Your Initial Source Code

Now, check in the source code which you have already copied into the git directory:

% git add *
% git commit -m "init commit" 
% git push  

If you are checking in for the first time on an empty repo (which is your case here), you should run:

% git push -u origin main

Instead of

% git push

Step 4: Share the Repo with Your Teammate

If you are working in a group, it is a good idea for all group members to share access to a single GitLab repo. You can enable sharing through the GitLab web interface. Hover over to Project information on the left sidebar, and click Members. Enter your team member’s Patriot ID and choose a role (Developer or Maintainer) for him/her.