Setup - GitLab (CS 200)
Table of Contents
This will step you through
- Creating a GitLab account (you can skip this if you already have one)
- Creating a repository for this class
- Adding "maintainer" access for the instructor
1. Introduction
What is GitLab?
GitLab is a source code hosting web service. You may have also heard of GitHub, which is a similar service, but GitHub is owned by Microsoft (ew).
We are going to be using GitLab throughout this semester to store code. This also gives us an easy way to share code, so if you get stuck on an assignment you can save your changes to the server and I can look at them on my computer with one click.
What is Git?
Git is a piece of software that allows you to interact with Git servers easily.
What is a repository?
Each project (or software program) usually has its own repository. For our class, each student will have 1 repository for all their coding assignments, with assignments separated into folders. The instructor creates the repository and folders with starter code for you, and you will need to use the Git software to download it to your computer.
2. Set up a GitLab account
(If you already have a GitLab account you can skip this step. Note - Git LAB not GitHub.)
- Start at the GitLab sign up page.
- It will let you sign in with a Google account (below), but if you do this you will need to do a password reset from the GitLab Edit Profile page so that you know the password - which you will enter in on your computer later.
- Sign up with a name and username. You can use your student email if you'd like - you can always change it later on.
- If the sign up process asks what you're using GitLab for, you can mark "Education" or "Other".
- You do not need to pay anything; just navigate from any pages that ask for payment.
- If it asks for a “Company Name” you can just put JCCC.
2.1. (Optional) Reset password (if you registered via other account)
Figure 1: Screenshot of GitLab, user having clicked their profile image, and is selecting Edit profile.
If you registered with an existing Google account then GitLab won't know your password, but you'll need a password to use Git on the desktop. You will have to reset your password in GitLab.
Once you're logged in click on your profile picture circle and select "Edit profile".
Figure 2: A screenshot of the Change Password screen, including the I Forgot my Password link.
Then go to the "Password" section. You'll probably have to do the "I forgot my password" link in order to set up an actual password.
3. What's your GitLab profile?
Figure 3: Screenshot of the user clicking on their profile image, then selecting their name to go to their profile.
Once you're done registering you should be able to get to your GitLab profile page. Click on the profile picture circle and select your username at the top.
Figure 4: Screenshot of a profile page on GitLab.
This should take you to your GitLab homepage, which will be gitlab.com plus your username, similar to https://gitlab.com/rsingh13.
Assignment part 1: I will need to know your GitLab username, make sure to copy/paste this URL into the assignment!
4. Create a GitLab class repository
Figure 5: Screenshot of selecting 'New project/repository' from the plus menu.
NOTE: If you have a repository from a previous semester, you can reuse that.
Click on the "+" button at the top of the GitLab page and click "New project/repository".
On the next screen, click "Create blank project". Then set up your repository.
Figure 6: Screenshot of the GitLab new repository screen.
- Project name: Use your school SSO and "-cpp" for C++ (e.g. "rsingh13-cpp"). (Note: If you take more of my C++ classes you'll be reusing this repository!)
- Project URL: gitlab.com / YOURUSERNAME / YOURSSO-cpp (this gets auto-generated).
- Don't select a deployment target.
- Visibility Level: Private
Configuration: Initialize repository with a README
Then click the blue "Create Project" button.
Make sure to bookmark this repository page!
Assignment part 2: Copy/paste the project URL into the assignment.
5. Configure repo to give instructor access
Figure 7: Screenshot of the left sidebar nav for the repository, selecting 'Manage' and then 'Members'.
From your repository page, there's a left navigation bar (you might have to expand it). Go to Manage and then Members.
From the next page, click the blue "Invite members" button.
Figure 8: Screenshot of the Invite Members screen, with the instructor being added as a maintainer.
- Username: rsingh13
- Select a role: Maintainer
Then click the blue "Invite" button.
6. Why are we using source control?
- Source control is an important tool for software developers. While it can be intimidating at first, it’s much better to learn it in school than to have to pick it up on the job. :)
- Since this repository is shared between us whenever I have feedback for your work I can add comments to your code and sync it with the GitLab server. You can then pull down the comments, make fixes, and re-sync your work.
- I can write a command line script to pull down changes from everybody’s repositories, which makes the grading process easier for me. ;)