Lets talk about some Git branching strategies for a cohesive, collaborative development environment. This should successfully work even for globally distributed teams, as long as people use the following guidelines, while naming their branches. Just to reiterate, I assume you are comfortable with the various git concepts, such as branches, tags, pull requests.
master - should only hold code run through the complete regression cycle and ready for release, each product release should be separately tagged in the master branch.
dev - should include the latest feature-complete development code. Hence code in this branch is feature-developed and feature tested but not necessarily full regression tested.
feature branches - should be branched out of dev/another feature branch and should only include development code. Once the feature is developed and tested a pull request should be raised, which once reviewed should merge the feature branch back to its parent branch.
feature branch naming strategies - feature development branches should be named using the following format : -
The reason behind the use of a back-slash '/' after the dev initials is; this would help us group all branches created by a particular developer in most git GUI tools.
E.g if Donald Trump is working on a Jira ticket named 1234 - UI Fixes and the parent branch is dev, I would suggest the feature branch should be named in the following format : -
Moreover always merge branches back to their parent branches using a pull request, followed by a code review by your peer. And please don't forget to delete your feature branch once its merged back to its parent branch.
If you have comments/feedback please share them below.
master - should only hold code run through the complete regression cycle and ready for release, each product release should be separately tagged in the master branch.
dev - should include the latest feature-complete development code. Hence code in this branch is feature-developed and feature tested but not necessarily full regression tested.
feature branches - should be branched out of dev/another feature branch and should only include development code. Once the feature is developed and tested a pull request should be raised, which once reviewed should merge the feature branch back to its parent branch.
feature branch naming strategies - feature development branches should be named using the following format : -
Developer Initials/parent branch_feature_name_feature_ticket_num,
The reason behind the use of a back-slash '/' after the dev initials is; this would help us group all branches created by a particular developer in most git GUI tools.
E.g if Donald Trump is working on a Jira ticket named 1234 - UI Fixes and the parent branch is dev, I would suggest the feature branch should be named in the following format : -
dt/dev_ui_fixes_1234
Moreover always merge branches back to their parent branches using a pull request, followed by a code review by your peer. And please don't forget to delete your feature branch once its merged back to its parent branch.
If you have comments/feedback please share them below.