Today as I was talking with a friend about Git and when or not we should switch a repository from SVN to Git, I thought up a pretty good analogy. So I thought I would share this to those who are looking to learn Git, and hopefully put them in the right mindset.

The Goal

Ultimately, when people talk about Source Control, they have the same concepts in mind. I want to be able to easily update my source control, collaborate with others, and have a history of changes that I can review and use to make other changes. So for our Analogy, these basic concepts, we’re going to call Getting from point A to point B.

SVN, The Car

With SVN (aka Subversion), I like to compare it to a car. You can hop in, drive around, and get from point A to point B with relative ease. You do need to learn how to drive a car, but after a little while, you get the hang of it. Eventually, you can get pretty good.

You get from point A to point B by combining things like accelerating forward and turning left and right. Maybe you perform even more complicated maneuvers like accelerating in reverse and turning the opposite direction to back up. Some people can even tackle crazier terrain and go off roads with their cars. All and all, it is a very versatile and well suited for the job. It isn’t very difficult to learn, and gets the job done.

Git, The Helicopter

Git, like SVN, can get someone from point A to point B. However, they approach the task with some fundamental differences. I like comparing it with going from driving a car to flying a helicopter. The helicopter is very versatile as well. It doesn’t require roads to travel along, and doesn’t get caught in traffic like cars can. They don’t have to deal with red lights or stop signs. To the normal driving looking up at them, it seems that they just “go.”

This is because you don’t just drive forwards and backwards, turning left and right. With a helicopter, you also go up and down. This adds an additional layer of complexity. You gain more mobility, but is crucial you understand the fundamental differences. For example, unlike a car when you accelerate and you go forwards, with a helicopter you punch the accelerator and you go up, not forwards. For anyone who has ever played a video game with realistic controls for a helicopter, it is hard. People have recorded tutorials teaching how to fly helicopters in games, and show the fundamental differences on how you approach flying. Even when flying planes in these games is similar to driving a car, many concepts are backwards when flying a helicopter.

Trying to Drive a Helicopter

So at lunch a guy hears his friends talk about how they skipped over traffic this morning, and got to work in minutes instead of the hour it normally takes. They rave how great it was, and so the guy asks if he could try it out. They say sure, and hand him the keys. He goes out, pops the keys in, and without trying to understand the fundamentals of flying a helicopter, he tries to drive it like a car. For those who have watched people try to “fly” a helicopter in a game without a clue, this is what it looks like:

When the player jumped in the helicopter, he punch the throttle thinking he’d go forward, and pulled back on the stick thinking he’d go up. Instead, he went up and backwards and then out of control.

When SVN users try out Git, and don’t learn or understand the fundamental differences, they get very frustrated with it. Even if they manage to duplicate their experience with SVN using Git, they are just adding more complexity without any real gains.

Learn the Differences

The difference comparison at the Git Wiki is fair in it’s assessments. It shows how each solution handles different features, and what impact it has. With Git, there are some drawbacks, such as you can’t just checkout a subset of a repository. You either download the whole thing (with history) or not.

If you approach using Git like it was SVN 2.0, you will be disappointed, frustrated, and will give up. Git is close enough that you can feel like you are using SVN, but when it doesn’t act like SVN, you won’t know why. So do yourself a favor, and when you sit down to learn Git, think “I’m used to driving a car, but I’m learning how to fly now. I’m learning something new.” If you approach it with this mindset, I believe you will be much more successful.