Mediascripting on the Web (CSC 195 2014F) : Assignments
This assignment gives you a chance to explore basic use of Git and GitHub.
git clone REPO
Make a copy of a repository. A typical repository address is
git add FILE
This can do one of two things. If FILE is not in the repository, it adds it to the repository. If FILE is already in the repository, it marks it as being part of the current set of files to be committed. (Often, you only want to commit only a subset of the files you've modified, so you use
git addon each of those.)
Get the status of your repository. What files have been modified? Which are staged for commit? Which are just new?
Commits all of the files you're added. Typically, pops up an editor. If vi pops up, use
ito switch to insert mode, type the text for the commit, and then type the escape key to get out of insert mode. Then, type
:wqto write the file and quit vi.
git commit -m "MESSAGE"
Commits the files you've added, using the given message. (A nice way to avoid the editor.)
git log | less
Shows a log of the changes that have been made. (
lesslets you page through those changes.)
Send your commits to the primary repository.
Grab other people's commits from the primary repository.
If you have not already done so, set up a GitHub account and send me an email message telling me about the account.
Find a partner so that you can do this at the same time. You are working with a partner so that you can see conflicts and how to resolve those conflicts. Each of you should do the following instructions on your own account.
Clone the repository at
Add a file to the
participants directory that describes you.
git add to add that file to the repository.
git commit to commit your change. Use a meaningful message like
"Added information about YOUR NAME HERE."
git push to send your change to the primary repository.
Look online to see if your change has been pushed.
Wait until your partner has pushed their update. Then use
to get their change into your repository. Verify that you have the new
git log or
git log | less to see a list of changes to the
Edit the file
participants.md to add your name. Then add the file,
commit it, and push it.
Whoever tries to push the file first will likely succeed. Whoever tries to push the file second will likely get an error message. Figure out how to resolve the error message.
code directory, there is a program that lists the members
of this class. Update
participants.c so that it prints your name, too.
(Follow the pattern of the file.) Make sure that your program works by
make and then
./participants. Then, add the file, commit it,
and push it.
Deal with any conflicts that have arisen and commit the result.
If you want to learn more about Git, that would be great. If you do learn
more about Git, please update
tips.md with anything useful you've
Some things that may be useful: Tagging commits, Branches, Comparing versions (diff), Standard work habits
Since your work is on GitHub, I can tell that you've turned it in. It even has a convenient time stamp.
Copyright (c) 2014 Samuel A. Rebelsky.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.