Become a Git Master

Ted Benson
@edwardbenson / eob@csail.mit.edu

Goal

Become a master of git-fu

  • Understand the "physics" of Git
  • How to use Git by yourself
  • How to use Git with a team
  • Get your feet wet hacking git

Git Physics

version control system

=

industrial strength dropbox  




your code project

How would you design this?

  • Entities (the nouns)
  • API (the verbs)

An Approximate Sketch

  • Project
  • Repository
    • Versions, Tags, Branches
  • Workspace
  • Files
  • Changeset
  • create(project)
  • join(project)
  • new_version(changeset)
  • get_version(n)
  • Reconcile differences
  • Import / Export with other projects

Two big questions:

What is the topology of a project?

How do you represent versions?

What is the topology?

Distributed v. Centralized

Distributed v. Centralized

DistributedCentralized
  • git
  • Mercurial
  • Bazaar
  • Perforce
  • Subversion
  • ClearCase
  • CVS

Centralized Version Control

Distributed Version Control

How do you represent versions?

Deltas: As a sequence of diffs for each file.

Snapshots: Each version is recorded in its entirety.

File Delta Version Tracking

File Delta Version Tracking

File Delta Version Tracking

File Delta Version Tracking

Snapshot Version Tracking

Snapshot Version Tracking

Snapshot Version Tracking

Snapshot Version Tracking

Deltas v. Snapshots

  • What are some of the tradeoffs?
  • Order analysis of repository size?
  • Order analysis of moving between versions?
  • How do you compare two versions?