After many discussions with a colleague about Git, I came to realize that Git is not merely a source control. With time it became a tool in my developer’s sandbox. To develop software effectively, I need (among other) an IDE or text editor, a prompt and countless libraries. I came to rely and trust these tools.
I used many other tools for version control but I saw them as infrastructure – mandatory in the grand scheme of things but not used to improve my productivity.
Git changed everything by allowing me to rethink the way commits andÂ branches work.
- By promoting small commits that do one thing but do it well, git forces me to split myÂ task in even smaller chunks that can then be commited. This sometimes leads to architectural changes.
- By making it possible toÂ Â reorder the commit history (git rebase -i origin), it pushes me to make each commit clean and atomic.
- Git makesÂ branching cheap and easy. Like you, I try to code each features in a separate branch. But unlike you, I am undisciplined and often forget. However if I start on a feature and realize it takes slightly longer than expected (and I’m talking about an hour max, not 3 days), I create a branch for that feature. It’s easy and it allows me to work in small, independent chunks. It also allows me to always be able to come back to a stable branch if I need to do a few quick fixes on another part of the project.
Git is not a mere tool – it changed the way I design and code.