Using Release Flow Branching: How to prevent Azure DevOps from showing all changes since the first commit for new release branches?

Jacques Oosthuizen 10 Reputation points
2025-03-17T14:56:35.6+00:00

I am using Release Flow branching in Azure DevOps, where each new release branch (release/x) is created from main.

  • How can I control how Azure DevOps determines "new changes" for a release branch?
  • Can I manually specify the previous release as the comparison base instead of it defaulting to the first commit?
  • Is there a YAML setting, UI configuration, or API method that allows me to change how changes are tracked between release branches?

Repo Steps to Reproduce:

  1. Create a new release branch from main.
  2. Run a build in Azure DevOps on release/x.
  3. Open the "View Changes" tab in the build summary.
  4. Azure DevOps shows all commits in the repository since the first commit, instead of just the changes between release/x-1 and release/x. Releases are triggered from release branches using YAML pipelines.

https://learn.microsoft.com/en-us/devops/develop/how-microsoft-develops-devops

User's image

Azure DevOps
{count} votes

1 answer

Sort by: Most helpful
  1. Gaurav Kumar 780 Reputation points Microsoft External Staff Moderator
    2025-03-20T12:33:39.24+00:00

    Hi @Jacques Oosthuizen ,

    Change the Release Flow Strategy:

    Instead of creating new release/x branches from main,

    create them from the previous release (release/x-1)

    Instead of this (creates issue in Azure DevOps):

    git checkout -b release/2.0 main
    

    Do this instead:

    git checkout -b release/2.0 release/1.0
    git push origin release/2.0
    
    • Ensures that Azure DevOps naturally tracks changes only since release/x-1.
    • Fixes the "View Changes" tab showing all commits since the first commit issue.

    Manually Specify Previous Release as Base:

    Tag the latest release (release/x-1) before creating a new branch:

    git tag -a release-1.0 -m "Tagging release 1.0" git push origin release-1.0
    

    Create a new release branch (release/x) from release/x-1:

    git checkout -b release/2.0 release-1.0
    git push origin release/2.0
    

    Manually compare releases in Azure DevOps UI:

    • Go to Azure DevOps → Repos → Branches
    • Click Compare branches
    • Select release/x as the target and release/x-1 (or tag release-1.0) as the base

    Or compare using Git CLI:

    git log release-1.0.. release-2.0 --oneline
    
    • Azure DevOps doesn’t have a built-in option in the UI or YAML to control how changes are tracked between release branches.
    • Use the following Azure DevOps REST API to manually compare the previous release (release/x-1) with the new release (release/x):
    curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN" \
    
    "https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repoId}/commitsbatch?searchCriteria.itemVersion.version=release/x&searchCriteria.compareVersion.version=release/x-1&api-version=7.1-preview.1"
    

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.

    User's image

    If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.