Why do I love GIT?

I get this question a lot, and it is a valid question. Those who know me, know that I am not into tools, don’t get me wrong, tools are great, but there is too much fokus on tools and not the craftmanship. It’s human to look for quick fixes; We hope that the new camera will make us a better photographer or new golf clubs improve our swing.
But there are days when a new tool comes along and actually improves your life.

I think GIT is such a tool.

GIT allows me to quickly create a project locally, start develop and share my code with others. It is decentralized and there is no need to have a centralized server (although you can if you want). But the things I am most excited about is the ability to quickly create a branch, explore a hunch, and quickly dismiss or merge it back to my head (master) branch and share the code with others. It is easy to create a new local branch and explore a new idea, or do refactoring, or… And the merge between different branches is without fear and stress, because it really works, it is fast and you almost never gets conflicts.

A really neat trick is the git-stash command, which I use when I started something and it develops to something I couldn’t forsee and I do not want it to be part of the current branch, e.g. you started to what you thought was a simple refactoring of a class and it turned out to be much more complicated and you do not know if this is something you are able to deliver in time, you want an option to continue without risk. I just stash the changes, and create a new branch and then pop the changes into the new branch and continue to explore the refactoring. To do this with other VCM you need to always create branches in advance, but for me this is not always an option, I would like to explore ideas without a lot of administration. git-stash is also great if you are interrupted and do not want to commit “unclean code” (not tested and may contain errors) before you switch branch and fix a bug or whatever the reason you was interrupted by.

There are many other scenarios this tool will help you with, but I leave that for you to explore by yourself. Gone is the feeling to be restricted by a version control system, instead it helps me to be more effective.