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.

Setup

Instructions

Creating Your Gitlab Account

  1. Navigate to https://gitlab.cci.drexel.edu
  2. Under LDAP, log in using your tux (CS) credentials
    1. Just use your username, not the full email address
    2. 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
    3. Click on link provided in the email
    4. Return to the Gitlab page
  3. You will be prompted to create a private/public key pair, and to upload the public key. Skip this for now. See below

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 ...) .

  1. Log into tux
  2. Use ssh-keygen to create the pair:
    ssh-keygen
  3. Go to your ~/.ssh/ directory
  4. Note the two new files:
  5. cat the public key to the screen
  6. Copy the contents of the file to the clipboard

Copying the Public Key Into Gitlab

  1. Log into Gitlab on a browser
  2. Choose Settings from the blue snowflake drop-down menu in the upper right
  3. Choose SSH Keys from the header row now below the snowflake
  4. Paste the public key, from above, into the Key text box
  5. Click Add key
  6. Clone the repository (project) using the SSH URL

Creating the Project (Repository) for Class

  1. Click New Project
  2. Set Project name to userID-CS265-sp18 where userID is your Drexel username

    Note: Case matters. Please pay attention.

  3. It is very important to leave visibility level set to Private (the default setting) so others can not view your work.
  4. Click Create project. You will be taken to your empty repository.
  5. 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
  6. 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

  1. From the project page, hover over the cog, near the bottom on the far left
  2. Choose "Members" from the pop-up menu
  3. Find the Select members to invite... text box
    1. Type in kschmidt (me), hit [Enter]
    2. Type in aff39 (Adam), hit [Enter]
  4. In the next text box, role permissions, choose Developer
  5. Please enter an expiration date, but choose one after the grade deadline
  6. Hit Add to project button

Cloning Your Repository (Repo) onto Tux

  1. Log in to tux
  2. Navigate to your course directory
  3. 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 "abc123@cs.drexel.edu" 
    git config --global push.default "simple"
  4. 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.

  5. Git should have created a subdirectory in the current directory for your repository.

Adding Files, Pushing Them Back Up

  1. cd into your Git directory
  2. Create a directory for Lab 1:
    mkdir lab01

    Remember: names and case matter.

  3. cd into the lab directory
  4. Create a file called lab1 (or, copy it in)
  5. 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.

  6. Commit your changes with a quick summary:
    git commit -m"Started Lab 1"
  7. To push your changes up to Gitlab:
    git push

    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.

  8. Thats it!
  9. `

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

Submission

Never tarfiles, tarballs, etc.

Upload this file to Blackboard Learn under the appropriate submission link.