How do i get buildnumbers per branch in vsts (now azure devops)

Viewed 419

I'm creating build definitions in vsts. I'm using $(Rev:.r) as my build number format. I want to be able to use this scheme separately for each branch. For example if i have 3 branches, master/develop/feature Master builds start from 1,2,3 Develop builds start from 1,2,3 Feature builds start from 1,2,3

2 Answers

Remember that Build number format can be configured at the Build definition level.

You can simply create a separate build definition for each branch.

  • Build Definition for master
  • Build Definition for develop
  • Build definition for feature

With the Build#Format as $(Rev:.r)

Related