CSE 333 Gitlab Setup
The following instructions are for connecting your CSE Linux environment
(attu or VM) to your GitLab repo in preparation for Homeworks 0-4.
Find Your 333 Repository
- Navigate to https://gitlab.cs.washington.edu
- If you have a CSENetID, use the green "CSE NetID" button; otherwise,
use the white "UW NetID" button
- In your list of Projects, you should see a CSE333 repo (named
cse333-21sp-students/cse333-21sp-<netid>) created
for you already.
- If not, please contact your instructor ASAP to have one created
Add Your SSH Key
This will allow you to access your repo without having to authenticate
(i.e., type your password) every time and will greatly improve
your workflow.
- Check to see if your CSE Linux environment (attu or VM) account already
has an SSH key
- Run
$ cat ~/.ssh/id_rsa.pub
- If you see a long string starting with ssh-rsa or
ssh-dsa, skip to step 3.
- Generate a new SSH key
- Copy your SSH key
- Run
$ cat ~/.ssh/id_rsa.pub
- Copy the complete key (starting with ssh- and ending
with your username and host)
- Add your SSH key to GitLab
- Navigate to your SSH Keys page by clicking on your avatar in the
upper-right, then "Settings", then "SSH Keys" in the left-side
menu.
- Paste in the "Key" text box and give a "Title" to idenfity what
machine the key is for.
- Click the green "Add key" button below "Title".
Your First Commit
From your CSE Linux environment (attu or VM), execute the following git
commands:
$ git clone <repo url from GitLab project page>
- Clones your repo -- find the URL by clicking the blue "Clone" button
in the upper-right of your project's details page.
$ touch README.md
- Creates and empty file called README.md.
$ git status
- Prints out the status of the repo -- you should see 1 new file named
README.md.
$ git add README.md
$ git commit -m "First Commit"
$ git push
- Publishes the changes to the central repo, which should now be
viewable (may need to refresh) in the web interface.
References