Azure DevOps-在Web UI中比较两个提交吗? [英] Azure DevOps - compare two commits right in the web UI?

查看:96
本文介绍了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.

即,我正在寻找与

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.

网络用户界面建议它可能是可能的,因为当查看特定提交的更改时,它具有文本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.

推荐答案

如果转到存储库的分支列表,则可以单击其中一个分支上的...(更多操作),然后选择Compare branches

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}
  • 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中比较两个提交吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆