Git. The software developers daily habit. Life feels incomplete and dirty without it. Version control existed before it, but Git’s supremacy has been established through its simplicity, convenience, and workflow. Yet Git also manages to provide immense ass-saving power, flexibility and work flow enhancement. Once paired with your distributed version control system of choice (e.g. Github/Bitbucket) collaboration becomes beautiful.
It is my contention that Git is an invaluable tool for making us better developers.
By adhering to good, liberal use of Git/Github’s core tools - commits, branches, pull requests, merges, rebasing and convenient rollbacks, our development process becomes streamlined and focused on TDD level micro goals.
The Git work flow that I have taken to heart is the simple Pull Request (PR) model. Which goes along the lines of:
1. Pull the latest master 2. Create a feature/bug/change branch 3. Make your changes 4. Push to remote branch 5. Send a pull request 6. Discuss the changes and make amends accordingly 7. Merge when agreed
The pull request model
I have read and tinkered with other models like GitFlow and forking styles but they seem unwieldy. The PR model is the most likely, in my mind, to be adhered to properly, encourages proper oversight (invaluable for us apprentices) and communication of changes.
Git and the PR workflow make us better by encouraging a continuous stream of changes and consciousness. What I mean by that is: make small, well considered, tested changes, and commit them into your local Git instance with an appropriately descriptive, yet cons ice message. This leads to a comprehensive, transparent overview of your development and decision making process, not just for your own reflection and improvement, but publicly available for your team member to review via the commit log. Paired with the PR workflow this makes for a very deliberate and almost qualitatively assessable record of your work and improvement as a developer.
Therefore Git, in my mind, is effective in the same realm as TDD in that it acts a guide and stabaliser of your work, but also as a self improvement, code review and team assessment tool. When leveraged properly and completely, only benefit is to be found. Extend this sentiment with the wonders of continuous integration and things all come together beautifully!
The take away: Invest some time into becoming fluent with Git. Do it for the invaluable career skill, project backup and collaboration tool set. Do it also for yourself, if they can build one of the worlds most successful operating systems with it (Linux), and the fact it spawned from this guys mind, the benefits to you are incalculable.