Assignment 2#
Due: Monday Sep 23rd at 11:59 pm ET
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:
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) in your home directory.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
andkluchman
as collaborators.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.
Create a new directory called
git-explore
in your home directoryCreate the following four files in the new directory:
README.md
,cv.md
,address.md
, andphone.md
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 forcv.md
, and so on). Make sure to use a commit message that indicates which file is being added.Use
git reflog
orgit log
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:
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 asgit status
to see what changes are made to your git 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 the first file. Check the status of files in your repo as wellgit status
to see what changes are made to your git repository.