Dudeman3000
Dudeman3000

Reputation: 601

Azure DevOps - compare master branch to master branch in the past

Is there an easy way to see changes in master compared to the master branch in the past?

I want to see all changes to a particular solution that have happened over the past 4 months. The view I get when I create a PR would be perfect, but as if I was creating a PR from master to master-4-months-ago.

Upvotes: 3

Views: 11860

Answers (2)

Tim Abell
Tim Abell

Reputation: 11901

You can just fiddle with the url:

https://dev.azure.com/[org]/[project-name]/_git/[repo-id]/ ...
branchCompare?baseVersion=[source-version]&targetVersion=[target-version]&_a=commits

Where source-version and target-version are one of:

  • GBxxxx where xxxx is a branch name
  • GTxxxx where xxxx is a tag name
  • GCxxxx where xxxx is a commit sha1

You can get org, project name and repo-id from the url of any page clicking around your repo in Azure DevOps.

Upvotes: 5

Josh Gust
Josh Gust

Reputation: 4445

There are a couple ways:

For a single file

Navigate to the file in the repo, select the compare tab, and apply the appropriate commit range.

enter image description here enter image description here

For all files

Use Tags.

Create a tag at the commit 4 months ago and a tag for HEAD. enter image description here

Then compare them. This will give you a list of commits between them and allow you to show the diffs.

The DIRECTION of the comparison matters for your results

This feature uses a similar concept to executing git log master.. from a branch that should be ahead of master. The result will be commits in the current branch that are not in master, whereas the reverse git log ..master shows commits that are in master that are not in the current branch.

This feature returns changes that are in the "target" tag that are not in the compare tag. Since we are looking at the tags on the same branch, setting the early tag tagA as the compare tag and comparing tagB to it, results are shown. However, setting the later commit tagB as the compare tag will not give results b/c there isn't anything in tagB that isn't also in tagA.

enter image description here enter image description here

enter image description here enter image description here

Upvotes: 8

Related Questions