Git Assignment

Video

Overview

Git is a version control system that software developers use to manage source code. Most developers use Git or something similar to it. For this reason, it is useful to become familiar with its basic operations, which you will do in this course.

The Git version control system was originally developed to manage the Linux kernel. Since then, it has become widely used for many projects, both open and closed source. In this course, you will submit your work on assignments by committing them into a remote Git repository that I set up for you.

In order for me to create a remote Git repository for you, I need a copy of the public key on the computer your Git client program uses when connecting to remote hosts. After I receive this from you, I will create an empty remote repository for you to push commits into and then I will send you instructions on how to clone this repository onto your local computer. In the top level of this cloned repository, you will create a folder for each assignment that you complete.

Instructions (step 1)

Follow these Git submission instructions to prepare your system for using Git in this course. Make sure that you send me your public key as explained in these instructions.

While you are waiting to receive a git clone command from me, complete the TryGit tutorial.

After completing the TryGit tutorial, familiarize yourself with the documentation for Git and the Git book. If you want to thoroughly understand Git, you should carefully read Chapter 9 on Git Internals.

Instructions (step 2)

You need to wait for me to send you the clone command to create your repository before you begin step 2 of these instructions.

After you receive the email, run the command I give you in your home directory. It will look something like the following.

cd ~
git clone your_name@web1.ias.csusb.edu:405.git

This will create a folder named 405 in your home directory, so make sure this folder does not exist prior to running the command. From this point on, I will refer to this folder by the expression ~/405.

The git tutorials and git book talk about the git init command, and you may have experimented with it. However, do not use git init to create the ~/405 folder. Instead, rely on the git clone command to create this folder for you. In our case, git clone is a simpler alternative to the git init command.

Tilda ~ represents a home directory on Unix-like operating systems such as Linux and OS X.

In ~/405 you will see a file named README.md, which contains some instructions to help you configure git on your system. Read and follow these instructions.

The file's extension .md stands for markdown, which is a markup language that's designed to be readable in both raw and interpreted forms. You can think of it as a lightweight substitute for HTML that many programmers use. You should read about the Markdown syntax, because each assignment folder that you create should contain a README.md file.

For this assignment, create a folder named git within ~/405.

In ~/405/git create a file README.md that describes the documentation you read and the experiments that you performed while completing this assignment.

Also in ~/405/git/README.md add a link to your Code School report card, which shows that you have completed the Try Git tutorial. The report card is private by default; you need to change this to public so that we can verify that you completed the tutorial. Here is my report card.

Use the following commands to push changes to your README.md file to your remote repository.

cd ~/405
git add git/README.md
git commit -m "completed git assignment"
git push

Assignment folder

When you are finished with this assignment, ~/405/git should contain the following file.