Adam's Introduction to CCI GitLab
This guide will help you setup a Git Repository on Drexel's GitLab server. You will submit all of your work for this
course using this repository unless told otherwise.
Creating Your Gitlab Account
You will be prompted to create a private/public key pair, and to upload the public key. Skip this for now. See
- Navigate to https://gitlab.cci.drexel.edu
Under LDAP, log in using your tux (CS) credentials
- Just use your username, not the full email address
- You will be sent an email, to your CS account, I believe
- Unless you've changed it, it is forwarded to your Drexel account, by default
- Click on link provided in the email
- Return to the Gitlab page
Creatint a Private/Public SSH Key Pair on Tux
You can create a public/private key pair on tux, and upload the public key to GitLab (via the Web i/f).
You will then use the SSH transport protocol, and you won't be asked for your password.
Important! Do not show your private key to anyone. Do not send it to other computers. Make sure
it's readable only by you. (chmod 600 ...) .
- Log into tux
- Use ssh-keygen to create the pair:
- This will create an RSA (ver. 2) keypair
- Accept the default location
- You can leave the password blank
- Go to your ~/.ssh/ directory
- Note the two new files:
- id_rsa — your private key. Do not share this, nor copy to another
- id_rsa.pub — your public key. This is the one you put on distant computers to connect
to them using SSH.
- cat the public key to the screen
- Copy the contents of the file to the clipboard
Copying the Public Key Into Gitlab
- Log into Gitlab on a browser
- Choose Settings from the blue snowflake drop-down menu in the upper right
- Choose SSH Keys from the header row now below the snowflake
- Paste the public key, from above, into the Key text box
- Click Add key
- Clone the repository (project) using the SSH URL
- Note, the first time ssh will ask you if you want to connect to the host, warning about lack of a certificate
- Type "yes"
Creating the Project (Repository) for Class
- Click New Project
- Set Project name to userID-CS265-sp18 where userID is your Drexel
Note: Case matters. Please pay attention.
- It is very important to leave visibility level set to Private (the default setting) so others can not
view your work.
- Click Create project. You will be taken to your empty repository.
- Copy the URL (choose the SSH protocol from the drop-down menu) from the text box in the middle of the page
under the title
Save this link in a blank text file named url. You will submit this file to Blackboard Learn,
just this once, so we can access your repository, check that you named it properly, etc.
Granting Us Access to your Repository, For Grading
- From the project page, hover over the cog, near the bottom on the far left
- Choose "Members" from the pop-up menu
- Find the Select members to invite... text box
- Type in kschmidt (me), hit [Enter]
- Type in aff39 (Adam), hit [Enter]
- In the next text box, role permissions, choose Developer
- Please enter an expiration date, but choose one after the grade deadline
- Hit Add to project button
Cloning Your Repository (Repo) onto Tux
- Log in to tux
- Navigate to your course directory
- If you've set up your git global config on tux, do it now:
git config --global user.name "abc123"
git config --global user.email "firstname.lastname@example.org"
git config --global push.default "simple"
- Copy the url to your repository that you saved eariler and execute the following command:
git clone paste-URL Git
You may see a warning about cloning an empty repository, but don't worry about that.
Git should have created a subdirectory in the current directory for your repository.
Adding Files, Pushing Them Back Up
- cd into your Git directory
- Create a directory for Lab 1:
Remember: names and case matter.
- cd into the lab directory
- Create a file called lab1 (or, copy it in)
- Introduce the new file to git:
git add lab1
Or, to add all files in and below the current directory:
git add .
Note: git won't add empty directories to the index.
- Commit your changes with a quick summary:
git commit -m"Started Lab 1"
- To push your changes up to Gitlab:
If you used HTTPS, you'll be prompted for your password.
You needn't push up to Gitlab every time you commit. You do really need to do this before a
lab/assignment is due.
- Thats it! `
Verifying Your Files in Gitlab
If you want to double check that your files made it, you can log back into the gitlab website and view your commited
files by navigating to your repo under Projects
Never tarfiles, tarballs, etc.
- url - a text file containing only the url to your repository
This is a plain text file named url not url.txt
Upload this file to Blackboard Learn under the appropriate submission link.