2

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.

Dudeman3000
  • 551
  • 8
  • 21
  • Hi, does Josh's answer help you achieve what you want? Feel free to share your latest progress. – Mengdi Liang Jul 22 '19 at 06:40
  • Josh's answer is helpful, I marked it as the answer. But what I want isn't a list of individual commits, I'd like to see all the changes for a file / all files for every commit from point A to point B. – Dudeman3000 Oct 23 '19 at 19:42
  • @Dudeman3000 This question is still not marking an answer as accepted. What about the illustration for showing the actual **Compare** (read: diff) for a single file or for all files is not sufficient to your comment? [Single file diff for range of commits](https://i.stack.imgur.com/CBETs.png) and [All file diff between tags](https://i.stack.imgur.com/uTEB5.png) should give you what you want `"I'd like to see all the changes ..."`. If this isn't getting you where you need to be, would you consider updating your question with more detail? That would help others understand what you need. Thanks. – Josh Gust Nov 22 '19 at 16:10
  • Apologies @JoshGust, I've marked your response as the answer. – Dudeman3000 Dec 03 '19 at 18:05

2 Answers2

7

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

Community
  • 1
  • 1
Josh Gust
  • 4,102
  • 25
  • 41
5

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.

Tim Abell
  • 11,186
  • 8
  • 79
  • 110