tags

Syllabus for Collaborating with git

Another name for this session could be “Three Objects and Three Trees”.

Overview

We will learn git’s data model, consisting of three objects. We will learn git’s local-change-management model, which manipulates three trees. In the course of running a collaborative software development exercise, We will use git commands to examine the state of git objects on these trees, and move them back and forth. Some of these commands may be familiar (e.g., ‘git checkout’, ‘git add’, ‘git commit’, ‘git status’, ‘git diff’) and some may not (‘git reset’, ‘git diff --staged’).

Goals

  1. Understand the git data model (The Three Objects) well enough to describe a git commit in terms of its objects.
  2. Understand the local state of your latest changes well enough to move them between The Three Trees with basic git commands such as ‘git add’, ‘git commit’, and ‘git reset’.
  3. Gain a deeper understanding of what familiar git commands (such as ‘git merge’) are accomplishing.
  4. Know how your chosen workflow should change the commit graph, and use git commands to make it so.
  5. Gain confidence to make changes knowing that git has your back.

Objectives

By the end of this course, students will be able to…

Demonstrate these skills:

Explain these terms and concepts:

Use these commands, and understand them in terms of the 3 objects/3 trees:

Identify and explain these components of a repo graph (as seen with “git log --all --decorate --oneline --graph”):

Three Objects

Git is a brilliantly simple data model surrounded by a dense constellation of commands and options. Once you know the model, you know how the graph should look. Then you are equipped to find the command that does want you want.

See Git Objects.

Three Trees

The word “reset” is loaded with so many connotations that it is nearly meaningless. For the purposes of this session, you can read “reset” as “set-current-branch-to-a-commit”. We’ll explore how this works for managing local changes.

See Reset Demystified.

These are the three trees: