Assignment 1#

The goal of this assignment is to work with Bash, git, and GitHub. If you finish the main part of the assignment, continue with the optional ones.

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 spirit animal.

    • Secondary heading entitled “Education”

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

  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 repository

  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 geog313-assignments in your home directory.

  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 geog313-assignments. (Call it exactly like that. Do not vary the spelling, capitalization, or punctuation.)

  6. Push your geog313-assignments repository to GitHub

  7. On GitHub, go to “settings” -> “collaborators” and add hamedalemo and zay1996.

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

[Optional] 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. Create a new directory called git-explore in your home directory

  2. Create the following four files in the new directory: README.md, cv.md, address.md, and phone.md

  3. In four different commits, add and commit each of the four files to your Git repository. (e.g. the first one would be for README.md, the second for cv.md, and so on). Make sure to use a commit message that indicates which file is being added.

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

Now you can try two things:

  1. Use git revert <ID> to remove the changes associated with a specific commit. This command does not remove any changes commited after the commit ID you are using. Use this command to remove the third commit you used to add a file, and then check the status of files in your repo as well git status to see what changes are made to your git 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 first file. Check the status of files in your repo as well git status to see what changes are made to your git repository.