git icon
98-174:
Modern Version Control with Git
Announcements
Mar 27: Final exam on April 3
Just a reminder that the final exam will be on April 3rd. The format of the exam will be similar to that of the midterm exam, and although it will heavily feature the content from lectures 5 through 8, it will certainly have some material from lectures 1 through 4.
Feb 13: Midterm exam on February 20
Just a reminder that the midterm exam will be on Feb. 20, to avoid conflicts with other class exams that tend to be around the same time. If you still have outstanding conflicts with this date, please email me and we can arrange a make-up exam.
Jan 16: Website up and lectures posted
The weekly lectures will be posted here, along with the homework assignment for the following week. I will also occasionally post announcements (reminders) of important dates, like the midterm and final, though I will also send class-wide emails for important issues. If you're still waitlisted for the class and are concerned about getting in, please send me an email, otherwise feel free to drop the class via SIO. As always, if you have any questions/comments/concerns, please don't hesitate to email me.

Lectures
L# Date Topic HW Due HW Out
L1 Jan 16 Course Introduction, git clone None HW1
L2 Jan 23 Basic Git Commands HW1 HW2
L3 Jan 30 Branching and Merging HW2 HW3
L4 Feb 6 Working with Other Developers HW3 HW4
L5 Feb 13 Git Internals HW4 HW5
-- Feb 20 Midterm Exam HW5 --
L6 Feb 27 Advanced Git I: Reviewing History -- HW6
L7 Mar 6 Advanced Git II: Editing History HW6 HW7
-- Mar 13 Spring Break! -- HW7
-- Mar 20 Class Postponed -- HW7
L8 Mar 27 Release Management HW7 HW8
-- Apr 3 Final Exam HW8 --
L9 Apr 10 Final Exam Feedback ; Getting Help -- --
-- Apr 17 Spring Carnival! -- --

Homework
Homework 1 (Due Wednesday, Jan 23)
  • Download the Git project using git clone, which can be found on GitHub or the official Git website
  • Clone the Git project into your public folder: ~/public/98174/hw1/
  • After cloning, you should have a directory named ~/public/98174/hw1/git/
  • The Git project is about 52MB large, so it should fit fine in your AFS space
  • The AFS machines (unix.andrew.cmu.edu) have Git version 1.7.1 already installed, but you can also install Git on your own machine using your favorite package manager
Homework 2 (Due Wednesday, Jan 30)
  • Create a new repository at ~/public/98174/hw2/
  • Make two new files, foo.txt and bar.txt
    • Commit both of them (initial commit)
  • Change foo.txt somehow
    • Commit that
  • Remove bar.txt from the repo
    • Commit that
Homework 3 (Due Wednesday, Feb 6)
  • Clone your repository from Homework 2 into ~/public/98174/hw3/
  • Add a file, conflict.txt, with some lines to the repository
    • some lines := around 5? Pick your favorite haiku!
  • Make two branches, add and remove
  • In the add branch, add some lines to the file (conflict.txt) and commit the change to that branch
  • Similarly for the remove branch, remove some lines from the file and also commit to its branch
  • Merge both branches into master and resolve the merge conflict
Homework 4 (Due Wednesday, Feb 13)
  • There's a shared Git repository for the class at ~cakrivou/public/98174/s13/hw4
    • Clone the repository somewhere
    • Make (touch) an empty file named <andrew_id>
    • Add and commit the file to the repository
    • Push your addition to the shared repo!
      • Git should already know where to push to
      • If you get a message about not being able to update due to fast forward: fetch, merge and try pushing again
Homework 5 (Due Wednesday, Feb 20)
No homework! Just review slides for the midterm exam.
Homework 6 (Due Wednesday, Mar 6)
  • Clone the homework 6 repository into your public directory:
    • Source: ~cakrivou/public/98174/s13/hw6
    • Dest: ~<your_andrew_id>/public/98174/hw6
  • There should only be one commit in the project when you first see it
    • but the rest are not lost!
  • Try to restore the repository to its original state, using the commands we looked at in class
  • Once the repository is restored:
    • take the non-README file from master~1
    • put a copy in the working directory of the repo
    • make a new commit with the old file, effectively "reverting" the file
Homework 7 (Due Wednesday, Mar 27)
  • Clone the homework 7 repository into your public directory:
    • Source: ~cakrivou/public/98174/s13/hw7
    • Dest: ~<your_andrew_id>/public/98174/hw7
  • Revert master~2's commit, using git revert
  • Squash all commits into one (well, two; you can't squash the initial commit) using git rebase
Homework 8 (Due Wednesday, Apr 3)
No homework! Just review slides for the final exam.

About the Class
Course Number: 98-174
Course Title: Modern Version Control with Git
Lecture Time: Wednesday, 6:30pm
Lecture Room: GHC 4211
Grading Policy:
This is a 3 unit StuCo, graded pass/fail based on homework completion, a midterm, and a final exam.
Instructor:
Tired of sharing files over email for programming assignments? Wish you could go back in time to an earlier version of your code? Forgot what you changed last week? Ever tried learning about version control but have been too intimidated by all the different tools and workflows?

This course offers an introduction to version control by teaching you how to use Git, a very popular, modern version control system. Come learn about an invaluable tool that will make you a more effective developer, whether it's managing code for CMU course assignments, personal or extra-curricular projects, or even getting a head start on using version control at a summer job. In this course we will briefly explore what version control is, but we will focus on the basics of using Git for your own projects and projects with other developers. We'll also cover advanced Git usage and even take a look at how Git works under the hood.

Feel free to email me with any questions or comments!


Website designed by Arjuna Hayes, achayes