Branching and merging with git is one the features that make it worth to use git. Having a successful branching model is key to be able to respond to everyday needs.
Why create the overhead? The simple use case when a project is in production and new features are being developed requires that you have a work flow that allows introducing fixes without having to release the entire development code. You dont want to wait for a stable release of all features currently in development. Read all about it here http://nvie.com/posts/a-successful-git-branching-model/ [2]
To minimize the overhead we can something called git flow. Its command provide a great relief. For example, initializing your repo:
git flow init
creating a feature branch with:
git flow feature start homepage
Finishing a branch with:
git flow feature finish
The same logic is applied for release branches where it will merge with the master and back to develop. This way the master branch can not ahead of develop.
Hot fix branches allow you to merge into develop and into the master so you can fix things and deploy directly to production.
Install git flow
https://github.com/nvie/gitflow#readme [3]
https://github.com/nvie/gitflow/wiki/Linux [4]
Install git flow complete
https://github.com/bobthecow/git-flow-completion#readme [5]
Git flow remote
http://www.scottw.com/setting-up-git-flow-remote [6]
Continous integration
How about merging this work flow into your Continous integration process? What can be done is that on development we test the development branch continuously every time we do a merge on it. Read the next blog post on using git flow in your continuous integration process.
Links
[1] https://dominiquedecooman.com/blog-topics/git
[2] http://nvie.com/posts/a-successful-git-branching-model/
[3] https://github.com/nvie/gitflow#readme
[4] https://github.com/nvie/gitflow/wiki/Linux
[5] https://github.com/bobthecow/git-flow-completion#readme
[6] http://www.scottw.com/setting-up-git-flow-remote