Branching strategies

Feature based

A developer works isolated from the main branch until the feature is complete. Once development is done, the branch is merged into the main branch.

BenefitsChallenges
Completely isolatedComplexity the longer the branch lives
Multiple features can be developed at the same timeIntegration only happens as soon as you merge to main
Stable main branch

Trunk based

A developer pulls and commits to the main branch multiple times per day. Either no, or very short lived branches are used.

BenefitsChallenges
Small feedback loop due to frequent integrationDiscipline of developers is needed to integrate often and keep main stable
Merge conflicts are easier to solve as the code changes are smallerAutomated testing is required to guarantee quality of the main branch
Everyone is using the latest version of the codebaseMindset to immediately fix main in case of failing builds is required