"Advanced" git

Outline

Level setting and caveats

git's reputation

They say git gets easier once you get the basic idea that branches are homeomorphic endofunctors mapping submanifolds of a Hilbert space.

— Kornel (@pornelski) March 25, 2013

What makes up a repository

repo contents

Normal: Everything except the working tree is inside .git/.

Bare: .git/ is all there is.

What makes up a commit

commit contents

A commit's identity (it's SHA-1 digest) is intimately tied to its entire ancentry.

Analogies and conceptual models

git builds the DAG

the DAG

Branching

Before

branch before commit

Branching

After

branch after commit

Cherry-picking

Before

before cherry-pick

Cherry-picking

After

after cherry-pick

Merging

Before

before merge

Merging

After

after merge

Rebasing

Before

before rebase

Rebasing

After

after rebase

Fast-forward merge

Before

before fast-forward merge

Fast-forward merge

After

after fast-forward merge

Stashing

Patching/interactive adding