Migrating from Trunk Based development to Git-Flow workflow in Azure Repository

Migrating from Trunk Based development to Git-Flow workflow in Azure Repository

To change the git branching model from Trunk based to Git-Flow based, you have to first understand the basic difference between Trunk based development and Git-flow workflow.

  • Trunk based — dev branch taken of the master, and changes merged back to master, master always works
  • git-flow based — there is develop branch that dev branches are taken from and merged back to, when a release happens branch is taken off develop then tested, and then merged to master, master always works and in production.

The changes required to implement the migration are creating new development branch and applying policies to make it default merging branch and locking master branch.

No alt text provided for this image

Create a 'develop' branch.



No alt text provided for this image

Click on 'Repos -> Branches' to open branches settigns menu.

Go to Branches to apply 'Branch Policies'.


Change default branch from "master" to "develop"

No alt text provided for this image

Select the 'develop' branch row.

Click on the right side dots and open the properties menu of the 'develop' branch.

Select 'Set as default branch' and set the 'develop' branch as ' default' branch.



No alt text provided for this image

Select the 'master' branch row.

Click on the right side dots and open the properties menu of the 'master' branch.

Select 'lock' to lock the 'master' branch and prevent any future changes.

and set the 'develop' branch as ' default' branch.



No alt text provided for this image

Apply Branch Policies:

Apply branch policies to develop to mirror existing policies on the master branch (expected settings)

A. Required minimum number of reviewers

  • Minimum: 2
  • Prohibit most recent pusher
  • When new changes are pushed; Require at least 1 approval

No alt text provided for this image


B. Check for linked work items: Required

C. Check comment resolution: Required

D. Limit merge types: Squash only

E. Build Validation

  • Use .azuredevops/azure-pipelines.yaml
  • Ensure build validation pipeline?Pipelines - All (azure.com)?appears in the "Platform" folder

F. Automatically include reviewers; Enabled

  • Have the same list of [Data Exchange]\Reviewers-* groups
  • Allow requestors to approve their own changes: FALSE

Additional Notes:

If you want to do the long read:

The above documentation assumes you have the git-flow extensions installed in your local git path. But processes and principles still apply.

No alt text provided for this image

Intikhab Alam is a DevOps consultant and currently working on Big Data project.

要查看或添加评论,请登录

Intikhab Alam的更多文章

社区洞察

其他会员也浏览了