本文介绍了Azure DevOps - 在 Web UI 中比较两个提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这肯定是我忽略的简单事情.在 Azure DevOps Web 界面(未集成为 IDE 的一部分)中,我看到了如何将任何提交与其父级进行比较,但我不知道如何将其与任意提交进行比较.

This is surely something simple I'm overlooking. In the Azure DevOps web interface (not integrated as part of an IDE), I see how to compare any commit to its parent, but I can't figure out how to compare it to an arbitrary commit.

即,我正在寻找相当于 GitHub 的 compare/hash1..hash2 功能.

ie, I'm looking for the equivalent of GitHub's compare/hash1..hash2 functionality.

吸引力在于,Web UI 是每个人都通用的视图/工具,大概我可以获得我感兴趣的特定差异的链接并与同事分享.

The appeal is that the web UI is a view/tool common to everyone, and presumably I could get a link to the specific diff I'm interested in and share it with colleagues.

Web UI 建议 可能 是可能的,因为在查看特定提交的更改时,它有文本 Diff to Parent 1 - <my commit hash> 但我还没想好怎么改Parent 1.

The web UI suggests it might be possible because when viewing the changes for a particular commit it has text Diff to Parent 1 - <my commit hash> but I haven't figured out how to change Parent 1.

推荐答案

如果您转到存储库的分支列表,您可以单击其中一个上的 ... (More Actions)分支并选择比较分支

If you go to the list of branches for a repository, you can click on ... (More Actions) on one of the branches and choose Compare branches

这会将您带到以下形式的 URL:https://dev.azure.com/{organisation}/{project}/_git/{repository}/branches?baseVersion=GB{baseBranch}&targetVersion=GB{targetBranch}&_a=files

This will take you to a URL in the form:https://dev.azure.com/{organisation}/{project}/_git/{repository}/branches?baseVersion=GB{baseBranch}&targetVersion=GB{targetBranch}&_a=files

然后您可以更改查询字符串中的 baseVersiontargetVersion 参数.这些可以采取以下形式,并且可以混合搭配:

You can then change the baseVersion and targetVersion parameters in the query string. These can take the following forms, and can be mixed and matched:

  • GB{branchName}
  • GC{commitHash}
  • GT{tagName}

以防万一该链接被破坏,单击拉取请求上的查看合并更改"会将您带到同一页面,但 URL 略有不同 https://dev.azure.com/{organisation}/{project}/_git/{repository}/branchCompare?baseVersion=GC{baseCommit}&targetVersion=GC{targetCommit}&_a=files

Just in case that link gets broken, clicking "View Merge Changes" on a pull request takes you to the same page but with a slightly different URL https://dev.azure.com/{organisation}/{project}/_git/{repository}/branchCompare?baseVersion=GC{baseCommit}&targetVersion=GC{targetCommit}&_a=files

我不确定是否有更好的方法来比较 UI 中的 commits,因为它只显示分支和标签,但如果你这样做,你不必临时标记提交或创建临时分支只是为了获得显示所有更改文件的差异.

I'm not sure if there's a nicer way of comparing commits from the UI, as it only shows branches and tags, but if you do it this way you don't have to temporarily tag commits or create temporary branches just to get a diff that shows all of the changed files.

这篇关于Azure DevOps - 在 Web UI 中比较两个提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 04:24