UNB/ CS/ David Bremner/ teaching/ cs2613/ labs/ Lab 1

Background Reading

For every lab there will be some related reading. I'll point these out as we go through the lab, but I'll also collect them at the start of the lab in case you want to get a head start (or refer back to them later).

Part 0: Administrivia

Time
15 minutes
Activity
Reading, Q&A
  1. Take 5 minutes to skim the Course Syllabus. You're not expected to read all of the details now, but you are responsible for reading them all after the lab.

  2. What's similar to other CS courses you've taken?

  3. What's different?

  4. Key point, how are marks assigned for the lab we're just starting?

Part 1: Hello Computer

Time
15 minutes
Activity
Small groups, brainstorming
Summary
Linux command line review. VM. Text editors
  1. Split into groups of 2-4 people.

  2. Introduce yourselves.

  3. One person should "drive" the computer initially

  4. Start the VM

  5. In the VM, start a terminal

  6. Make a directory *

  7. Create a file in that directory using one of the available text editors

  8. Now clean up, removing the file and the directory.

  9. If you finish early, start again with a different driver and a different text editor.

Part 2: Frog Tutorial

Time
20 minutes
Activity
Individual work
Summary
Getting started with frog

We'll be using frog frog to keep a journal of what we learn in this course.

  1. Make a directory under fcshome that will keep all of your work for cs2613. For the rest of this lab we'll assume that directory is ~/fcshome/cs2613 viewed from fcs-cs2613-dev (or ~/cs2613, viewed from your normal FCS Linux account).

  2. Follow the frog quick start to create a frog project in a directory ~/fcshome/cs2613/frog.

  3. Start a new blog page for today's lab, and delete the fake entry created by the frog setup command.

  4. If you have extra time


Part 3: Git background

Time
15 minutes
Activity
Reading, Discussion
  1. Take 10 minutes and read - Section 1.3 from Pro Git. Don't worry if you don't get every detail now; you can always go back and re-read it later.

  2. Who has used a version control system before? Which one?

  3. What are the two most important concepts discussed in this reading?

Part 4: Setting up a git repo

Time
20 minutes
Activity
Individual work
Summary
This is where we create the git repository used for the rest of the term to hand things in.
  1. Read the git-quickref page, and follow the initial configuration steps there.

    • note that the "--wait" option for code-oss is important here.
    • One important technical detail is that there is a link from .gitconfig in the fcs-cs2613-dev home directory to your regular FCS linux home directory, so your git configuration is shared between those two environments.
  2. Change to ~/fcshome/cs2613. This directory should have one subdirectory called frog, which has the results of your experiments above with frog.

  3. Create the git repository

     $ git init
    

    Git will reply

     Initialized empty Git repository in /media/sf_FCS-HomeDir/.git/
    

    You’ve now initialized the working directory — you may notice a new directory created, named ".git". The path starting with /media has to do with with way that VirtualBox shared folders work.

  4. Next, tell Git to take a snapshot of the contents of all files under the frog, with git add:

    $ git add frog
    
Notes
Many revision control systems provide an add command that tells the system to start tracking changes to a new file. Git’s add command does something simpler and more powerful: git add is used both for new and newly modified files, and in both cases it takes a snapshot of the given files and stages that content in the index, ready for inclusion in the next commit.

This snapshot is now stored in a temporary staging area which Git calls the "index". You can permanently store the contents of the index in the repository with git commit:

   $ git commit

This will open and editor and prompt you for a commit message. Enter one and exit the editor. You’ve now stored the first version of your project in Git. See §5.2 of Pro Git for some hints about writing good commit messages. As mentioned in the class git policy, you will be marked on your commit messages, so you may as well get started with good habits.

If you have extra time, start the next part

Part 5 Pushing to a central repo

Summary
Learn how to upload your work to a server
Time
15 minutes
Activity
Individual work
Notes
You absolutely have to understand this before continuing in the course, since all marks in the course will be based on work pushed to the coursegit repos.

Since we are using the FCS git repositories there is an existing repository for all students who registered early enough. If it turns out there is no repository for you, you may have to talk to Sean Seeley.

Next steps

We'll pick next time with some more practice using Git, but you should have the bare minimum to hand in your work at this point.