12

Branching strategies: Git-flow vs. trunk-based development

 3 years ago
source link: https://www.devbridge.com/articles/branching-strategies-git-flow-vs-trunk-based-development/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Branching strategies: Git-flow vs. trunk-based development

Vytautas Paulauskas

03.29.21

Git-flow vs. trunk-based development

With Git platforms offered on the cloud, it is now easier than ever to create code repositories on a platform that you prefer.

Most popular platforms like Bitbucket, GitLab, GitHub, Azure DevOps, offer a free tier that is suitable to host open-source projects. Enterprise tiers are available for dedicated space for controlling employee and vendor access or advanced automation and reporting.

There are several popular branching strategies that you can adopt, the most popular are git-flow (a.k.a. long-lived feature branches) and trunk-based development.

Below, we compare git-flow vs. trunk-based noting key considerations for each.

Philosophy

Git-flowTrunk-basedAs far as possible from main branchAs close as possible to main branchNew features are being started from develop branchShort-lived feature branches are started from main branchNew release branch is derived from develop branch; after it’s stabilized, release branch is deployedMain branch is always in a state ready to be deployed to productionOnly hotfixes are derived from main branchHotfixes start from main or release branch; need to be cherry-picked back to main

Team composition

Git-flowTrunk-basedLack of seniority within the teamWell-composed and experienced teamWorking with other vendors/third partyTeam augmentation model

Product type

Git-flowTrunk-basedComplex, mature, monolithic productMicroservicesBrown-field productShort-lived feature branches are started from main branchModern single page application (SPA) / Mobile appsProof-of-concept (POC) / PrototypeDistributed system components

Authoring process

Git-flowTrunk-basedGovernedTeam-driven

Deployment

Git-flowTrunk-basedVarious deployment models can be usedContinuous Deployment practices are recommended:Feature togglesQuality gatesCanary testingSelf-service automation (eg. ChatOps)Monitoring

Release frequency

Git-flowTrunk-basedSlower release cadence, pre-determined scheduleTeams are able to iterate quickly and independently

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK