As you know Git is the most popular version control system nowadays which successfully has superseded its predecessors like SVN, Mercurial and Perforce. Probably you’re also familiar with GitFlow which is a branching model for Git, created by Vincent Driessen. The model is a git branching and release management strategy that helps developers keep track of features, hotfixes and releases in software projects. The workflow needs a lot of commands to type and to remember, so there’s even the git-flow library of git subcommands that helps automate some parts of the flow to make working with it a lot easier.
You have two main branches:
- master branch contains the latest production code that has been deployed, and versioned with appropriate tags for each release.
- develop branch that gets branched off master and contains the latest code for the next feature that is being developed. For each new feature there might be lots of feature branches (always branched off the “develop” branch).
Beside the main branches, there are so-called supporting branches:
Beside those, there are supporting branches:
- feature branches contain the development state for a single feature of the overall product (i.e. a user story). They are merged off the
- hotfix branches are branches for quick and severe bugfixes. they are usually branched off the master branch, fixed in the hotfix branch and then merged back in master and develop as well.
- release branch is a branch for preparing the next release. No new features will be developed on this branch but rather it contains some last fixes (also bugfixes) and adjustments for going into production.
A picture is worth a thousand words:
I use GitFlow in my daily basis at work and I find it very useful. It really helps to track changes in the repository, especially in the team consisting of many developers.
When I started developing the GoogleTasksManager project I was wondering whether the GitFlow isn’t too complicated for me. Though there’s no team, I’m the only one who’s working on the project. Maybe there’s a better way of managing the repository than GitFlow in that case? After a quick research on the internet, I found that there’s another way, GitHub Flow.
As you can see on the diagram, GitHub Flow approach is much simpler than the previous one. There’s only one important branch master, which should be always stable and ready to deploy to the production at any time. Feature branches are branched directly from the master and merged back to it when the feature is ready. What’s important, the code should be deployed to the production directly from feature branch to check if everything works correctly there, before it has been merged to the master. So there’s no need to have develop and release branches.
I really like an idea of deploying to the production directly from the feature branch and to not have develop and release branches. I think that GitFlow would be over complicated for me at the moment. So, I decided to give GitHub Flow a chance and it’s been working very well for now.