Merry Gitmas: A Holiday Analogy About How Git Works

December 19, 2013

Analogies always help me with comprehension. And this one, explaining git, is Holiday Flavored :)

So, lets say you are making holiday gifts. You and your sibling want to make baskets for your friends and family, filled with homemade cookies, candy, and trinkets.

Baking the cookies is you doing your work. When you’re finished baking them, you can add them to your basket (git add).

You can also remove(git rm) cookies or rearrange them. The basket is your staging area.

A git merge occurs when you add the brownies that your brother has been baking to the basket.

When you commit (git commit), you are wrapping up the basket with a pretty bow and a nice holiday card (your commit message).

You can do a git rebase to correct any errors. Say you forgot to add the candy canes! A rebase is when you unwrap the gift, change something in it, and rewrap it with a new bow and message.

A git push is when you are giving the basket away to your Mom or other recipient, and git clone is a whole other story. It is taking a finished set of baskets and making a perfect copy of it.

We’ll leave that kind of magic to Santa. Happy Holidays!!

This post is dedicated to Jesse Shawl :)