Version Control: What's in it for me?

8/2/15

When I was little, I had this book of traceable monsters (stay with me, this is going somewhere.)You could mix and match the head/body/arms/legs to create a silly little creature on a piece of tracing paper. If you wanted to be extra, extra careful, though, you would do each body part individually, on a separate piece of tracing paper, so that you if you messed up you didn't have to start all over. You only had to redo that one body part.

  • Still with me?
  • Version control's obviously a little more complicated than a stack of tracing paper, but that's how I like to picture it in my head. There's always transparency into what came before as each new layer is added, and there's also transparency as to who put that info there, what they took away, and when they did it. Since you might not be the only person contributing, this layer of transparency is extra important. And should something go amiss, you can remove the layers on top and go back to an earlier point to start building again.

    Git stores all the changes you've made, and lets you know if they're untracked (working), staged (meaning you've added them to the queue for commitment, essentially) or if you've committed that change, meaning in essence that you've accepted those changes and "saved" your work.

    So where does the somewhat confusingly named GitHub come in? Well, the name becomes less confusing if you remember that GitHub is just a website. Like the name implies, it's a hub of git users. The benefit of using GitHub is if you choose to open your code up, that you can connect with other users around the world for help and contributions to you project. Even if you're working with a specific team, proximity isn't an issue when you can all push your code to a website and have access each other's work there. And even if your project stays forever solo - what if, by chance, you one day have to switch computers? Well guess what - everything you've ever done has been pushed to GitHub and can be pulled to the computer you're now on. Everything is groovy!