π¦₯
Git Branch Strategyis a strategy or a convention over agitandGitHubacross a team directly involved in developing anapplication.
Git Branch Strategy is critical in a project that involves more than a single person following the overhead that could incur from understanding individual approaches and methodologies on communal git and GitHub branches and commits.
It appears that there are two common git branch strategies:
GitHub FlowGit Flowwhere the above strategies will be discussed in the following sections.
π±
GitHub Flowis a strategy strictly suggested byGitHubfrom itsofficial document.
GitHub Flow simply and largely works upon a single main branch, the main (master) branch, and various sub-branches can be created upon demands, including developing features, bug fixes, and etc.
GitKraken Available at here
Overall processes of GitHub Flow can be described below:
BranchPR (Pull Request)Reviews & CommentsMerge BranchesDelete BranchesGitHub Flow can offer the following advantages:
Consistent CI/CD followed by its simplicity.
projects As the trade-off to the above, the following challenges could occur:
Unable to support multiple versions of code in production simultaneously.
The lack of dedicated development branches.
GitHub Flow to be bug-proneπ
Git Flowis a strategy suggested bysoftware developerVincent Driessenin 2010 whereGit Flowdividesworkflowsinto varying types ofgit branches.
Git Flow aims to simplify the overall release process and further address issues that were unable to be addressed in the above GitHub Flow strategy.
GitKraken Available at here
Git Flow introduces the following git branches as its functioning core:
MainDevelopFeatureReleaseHotfixwhere the main and develop branches become the primary branches that persist over all git branch life-cycle and other feature, release, and hotfix branches in accordance to demands becomes created and removed.
There are no sequential processes within the Git Flow strategy. However, each branch has varying innate purposes where:
Main
commit history of publicly released versions.Develop
Feature
featuresdevelop branchdevelop branchRelease
QAdevelop branchmain branchHotfix
bug fixes after the release from the main branchmain branchThe Benefits of Git Flow can be summarised as below:
Various types of branches enable work organisation to be more intuitive.
Allows efficient testing over small branches.
Supports multiple production code versions.
The Challenges of Git Flow are:
Can overcomplicate and slow the development process and release cycle.
Due to the long development cycle, Not suitable for CI/CD.