These steps explain how to set up your CSE GitLab so that you can use Git in HW4, HW5, and in the rest of your time here!

Step 1: Log In to GitLab

All students in CSE 391 have been given access to the CSE GitLab service for this quarter. If you are a CSE major, you should log on using your CSENetID, otherwise use your UWNetID. Log on to CSE GitLab by going here: https://gitlab.cs.washington.edu/.

Step 2: Adding an SSH Key

In order to “talk” to the GitLab service from attu, another server, or your local computer, you’ll want to create something called an “SSH key” on those computers. These offer a way for you to log in to services without needing a password. After creating an SSH key for each of your computers, you’ll want to register that key with your GitLab account.

Caution

You need a different SSH key for every machine. attu is a separate machine from your local machine! If you created a SSH key on your local machine for a previous course but you are working on attu, you need to log on to attu and create a new SSH key on attu.

To learn more, please visit the CSE department’s guide to generate SSH keys: https://gitlab.cs.washington.edu/help/user/ssh.md. Some notes:

  • you should run these commands on the machine you do your homework on, e.g. attu.
  • generally, you should follow the steps under “Generate an SSH key pair” and “Add an SSH key to your GitLab account”.
  • a ED25519 key is sufficient.
  • we suggest you accept the default location for the key and that you do not add a password.
  • if you’re having trouble finding the SSH keys page, try visiting the URL: https://gitlab.cs.washington.edu/-/profile/keys
  • you can view the contents of a key by cating it directly, e.g. cat ~/.ssh/id_ed25519.pub

Step 3: Configure Git

Whether you are working on attu, another server, the VM, or your local computer, you will want to configure a few things before you get started with git.

First, set up your user information. You should use whatever email is associated with your GitLab account (if you’re a CSE major, your CSE email; otherwise, your UW email).

$ git config --global user.name "Your Name"
$ git config --global user.email yourEmail@uw.edu

Tip

You can check what you have set so far using git config –-list.

If you want to use an editor other than vim for commit messages, you may want to set your default editor, for example:

$ git config --global core.editor emacs

Tip

If you find yourself in vim by mistake, use :q (colon, the letter q, then enter) to quit.

push.default

Note: When you push, you may encounter a message like this when pushing:

warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'.

This new default value in Git 2.0 will be fine. You can make this warning go away by setting push.default to be the new default in Git 2.0 like this:

$ git config --global push.default simple