Git, GitHub, and Students is how we collaborate together during class. Exercises, such as this one, are how we submit work for the rest of class.
In this exercise we'll re-inforce several git
concepts and learn how to submit work. Work individually on this. If you finish, help other students.
- Git
- GitHub
- Fork this repository.
- Create a file called hello.txt.
- Make a commit with this file.
- Push this change to GitHub.
- Add the text "hello world" to line 1 in the file hello.txt.
- Make a commit with this change.
- Push this change to GitHub.
- Ask for an instructor to review your work.
- Redirect the output from
git log
into a file calledgit-log.txt
. NO TEXT EDITORS!. - Commit this file with the contents using
git add -p
. - Push this change to GitHub.
- Ask for an instructor to review your work.
- Log into students and create a submission for this exercise.
- Fork this repository to the other person's account. Clone this code to the other computer.
- On the original repository add "I hope this makes it!" on line 2 to the
hello.txt
. - On the newly forked repository add "Oh no! What's going to happen?" on line 2 to the
hello.txt
. - Make a commit on the first computer.
- Make a commit on the second computer.
- Merge these two changes together so they both end up on both user's GitHub, on lines 1 and 2, respectively.
- On one of the computers, over-write the old
git-log.txt
with the new output fromgit log
. - Ask for an instructor to review your work
When you're finished, you should BOTH have a repository on GitHub that has two files in, hello.txt
and git-log.txt
.
git-log.txt
contains the most recent output from git log
and hello.txt
looks like:
hello world
I hope this makes it!
Oh no! What's going to happen?
Now that you've finished this, get some paper and show what you just did visually:
- Draw the git tree
- Draw the interactions between each pair's computer and github
- Ask for an instructor to review your work