Assignment 2#

Due: Wednesday Sep 10th at 11:59 pm ET

The goal of this assignment is to work with Bash, git, and GitHub.

Create a Dummy Resume Repository#

Open your terminal and do the following tasks:

  1. Create a new directory called resume within your home directory

  2. Create an empty file within this directory called README.md

Now use your text editor (VS Code is recommended) to edit the file:

  1. Open your resume folder through VS Code.

  2. Open README.md in the text editor

  3. Open README.md in in Markdown Preview

    • You can arrange these files side-by-side so you can see your document rendered live.

  4. Edit the file in the editor. Add the following information:

    • Top level heading with your name

    • An image. It can be a photo of you or, if you prefer, a photo of your favorite animal.

    • Secondary heading titled “Education”

    • A list of schools you attended, hyperlinked to the websites of those institutions

  5. Save the file

Now go back to the terminal and do the following:

  1. Initialize a new git repository in the resume directory

  2. Add the README.md file to the git staging

  3. Create a new commit with a commit message

  4. Check the git log to see your commit history

  5. Go to GitHub and create a new public repository entitled resume

  6. Push your local resume repository to GitHub following the instructions.

  7. View your online resume at http://github.com/<your github username>/resume

Finally, go back to the editor and add a new subsection called “Research Interests” to your README.md file. Update your local git repository and push your changes to GitHub. Verify that the remote repository is updated.

To hand in this part of the assignment, put a link to it in the README.md file in the next part.

Create a Repository for Your Assignments#

Now that you know how to create a git repository, you should create your assignments repository.

  1. Create a new directory called geog213-assignments (if you are registered in GEOG213) or geog313-assignments (if you are registered in GEOG313) on your local machine.

  2. Create a README.md markdown file that contains your name and a link to your “resume” repo.

  3. Initialize a new git repository

  4. Add the file and make your first commit

  5. Create a new private repository on GitHub called geog213-assignments or geog313-assignments. (Call it exactly like that. Do not vary the spelling, capitalization, or punctuation.)

  6. Push your changes to the GitHub repository

  7. Navigate to your repository on GitHub, go to “Settings” -> “Collaborators” -> “Add People” and add hamedalemo and kordi1372 as collaborators.

    Note: the resume repository created in the first part of the assignment should be either set to public, or you need to add Hamed and Fatemeh as collaborators to that repository as well.

  8. Push new commits to this repository whenever you are ready to hand in your assignments

Undo Changes in a Git Repository#

It might happen that you commit new changes to your git repository, and later you decide to undo it. There are two options for undoing your changes namely git revert and git reset. In this exercise you will explore their differences.

  1. Navigate to the resume directory that you created in the first part on your local machine.

  2. Create the following three files in the directory: cv.md, address.md, and phone.md

  3. Add and commit each of the three files to your Git repository separately. (i.e. the first commit would be for cv.md, the second for address.md, and the third for phone.md). Make sure to use a commit message that indicates which file is being added.

  4. Use git log command to print out the history of your git commands. You can see the ID associated with each commit.

Now try two things:

  1. Use git revert <ID> to remove the changes associated with the commit for adding address.md. This command does not remove any changes committed after the commit ID you are using. Then check the status of files in your repo as well as git status to see what changes are made to your git repository. Run git push origin to update the changes on your GitHub repository.

  2. Use git reset <ID> to remove ALL commits after the commit ID cumulatively. Use this to remove all the commits you have made after the first commit to add the README.md file. Check the status of files in your repo as well git status to see what changes are made to your git repository. Run git push origin to update the changes on your GitHub repository.