GitLab Setup

Throughout CSE 333, you will use GitLab and git for version control (and collaboration) on exercises and homework. This guide walks through the one-time setup: connecting your CSE Linux environment to GitLab, configuring git, and cloning your repositories. Once you're set up, see the Git Basics guide for the day-to-day workflow.


Find your GitLab Repositories

  1. Log in to GitLab. If you have a CSE NetID, use the green "CSE NetID" button to log in; otherwise, use the white "UW NetID" button.
  2. In the Projects tab, you should find two CSE 333 repositories ("repos" for short):
    • The exercise repo cse333-26su-students/cse333-26su-ex-<netid> will be created shortly after Lecture 1.
    • The homework repo cse333-26su-students/cse333-26su-hw-<netid> will be created at the end of Week 1.

If you don't see your repos by then, please contact the instructor(s) ASAP to have them created.


Add an SSH Key

This will allow you to access your repo without having to authenticate every time (i.e., no more typing your password!) and will greatly improve your workflow.

  1. Check whether your account already has an SSH key by running:
    $ cat ~/.ssh/id_ed25519.pub ~/.ssh/id_rsa.pub
    • If you see a long string starting with ssh-ed25519 or ssh-rsa, you may have already made an SSH key. Skip to Step 3.
  2. Generate a new SSH key by running:
    $ ssh-keygen -t ed25519 -C "<netid>@cs.washington.edu"
  3. Print your SSH key to the terminal by running:
    $ cat ~/.ssh/id_ed25519.pub
  4. Highlight and copy the complete key (i.e., starting with ssh- and ending with your username and host).
  5. Add your SSH key to GitLab:
    • Navigate to your SSH Keys page by clicking on your avatar in the upper-right, then "Preferences", then "SSH Keys" in the left-side menu.
    • Paste your SSH key from Step 4 into the "Key" text box and give a "Title" to identify what machine the key is for.
    • Click the "Add key" button below "Expiration date".

Git Configuration

The git command looks for a file called .gitconfig in your home directory that holds options controlling git's behavior. Some commands (e.g., commit and push) print verbose warnings if certain options are unset; the commands below set them.

  1. $ git config --global user.name "<your name>"
  2. $ git config --global user.email "<your netid>@cs.washington.edu"
  3. $ git config --global push.default simple

These only need to be run once per user. They are idempotent operations so running them again does no harm. If you've configured git before, you can skip this section.


Cloning Your Remote Repos

The version of your repository that you view through the GitLab web interface is the remote repository. You can clone it to create a local copy.

You will need to clone both your homework repository and your exercise repository. For each,

  1. Navigate to your project's page, click the blue "Code" button in the upper-right, and then and copy the "Clone with SSH".
    git@gitlab.cs.washington.edu:cse333-26su-students/cse333-26su-<netid>-ex.git
  2. In your terminal, navigate to the directory where you want your local copy and run the clone command:
    $ git clone <repo url>
    This copies the content of the remote repository onto your machine. At the start of the quarter, these repos may be empty.

That's the one-time setup complete. For the day-to-day workflow (pulling, committing, pushing, recovering from mistakes, and tagging commits for submission) continue to the Git Basics guide.