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:
Create a new directory called
resume
within your home directoryCreate an empty file within this directory called
README.md
Now use your text editor (VS Code is recommended) to edit the file:
Open your
resume
folder through VS Code.Open
README.md
in the text editorOpen
README.md
in in Markdown PreviewYou can arrange these files side-by-side so you can see your document rendered live.
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
Save the file
Now go back to the terminal and do the following:
Initialize a new git repository in the
resume
directoryAdd the
README.md
file to the git stagingCreate a new commit with a commit message
Check the git log to see your commit history
Go to GitHub and create a new public repository entitled
resume
Push your local resume repository to GitHub following the instructions.
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.
Create a new directory called
geog213-assignments
(if you are registered in GEOG213) orgeog313-assignments
(if you are registered in GEOG313) on your local machine.Create a
README.md
markdown file that contains your name and a link to your “resume” repo.Initialize a new git repository
Add the file and make your first commit
Create a new private repository on GitHub called
geog213-assignments
orgeog313-assignments
. (Call it exactly like that. Do not vary the spelling, capitalization, or punctuation.)Push your changes to the GitHub repository
Navigate to your repository on GitHub, go to “Settings” -> “Collaborators” -> “Add People” and add
hamedalemo
andkordi1372
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.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.
Navigate to the
resume
directory that you created in the first part on your local machine.Create the following three files in the directory:
cv.md
,address.md
, andphone.md
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 foraddress.md
, and the third forphone.md
). Make sure to use a commit message that indicates which file is being added.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:
Use
git revert <ID>
to remove the changes associated with the commit for addingaddress.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 asgit status
to see what changes are made to your git repository. Rungit push origin
to update the changes on your GitHub repository.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 theREADME.md
file. Check the status of files in your repo as wellgit status
to see what changes are made to your git repository. Rungit push origin
to update the changes on your GitHub repository.