Skip to content

Instantly share code, notes, and snippets.

@chrisvest
Last active December 16, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisvest/5436917 to your computer and use it in GitHub Desktop.
Save chrisvest/5436917 to your computer and use it in GitHub Desktop.
Git Pancakes

A Git repository is like a stack of pancakes. A really weird stack of pancakes.

The top pancake is the most recent revision of your code.

The index is the cake batter you have baking in your pan. It'll become a beatiful pancake when you think it is done, and be added to the top of your stack. The cake batter in your bowl are the changes you have neither committet nor added to the index.

A commit is when a pancake is done baking, and you commit it and place it on the top of your stack.

A branch is when you impale your stack with two steel wires, such that you can start two new stacks on top of your current stack. Actually, though, a branch is just the name you give to "the top pancake" of a stack, so it's like a pointer in that sense, and a tag is a pointer to a specific pancake placed somewhere in the middle of it all.

A merge is when you twist two or more wires back together, so many stacks become one. A fast-forward merge is when you don't need to twist any wires, but can simply place one stack directly on top of another - often because it was already like that to begin with.

A rebase is when you take out part of a stack of pancakes, and rearrange the individual pancakes on top of another stack - or the same stack, for that matter. Rebasing gives you greasy fingers. It can also topple other peoples stacks, if you have shared your stack of pancakes, so be careful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment