Azure DevOps - compare two commits right in the web UI?

半世苍凉 提交于 2020-01-14 04:52:48

问题


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.

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.

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.


回答1:


If you want to compare two arbitrary commits for one file, navigate to the file in the repo, select the compare tab, and apply the appropriate commit range.

If you want to compare two arbitrary commits for all files , you can create tags at commits , then compare them. This will give you a list of commits between them and allow you to show the diffs.

For details, you can refer to this case.




回答2:


The "Diff to Parent 1" feature is described in "Commit details / What are the changes included in the commit?"

Diff to parent - Click on Diff on parent1 in the Source Explorer pane to view the difference between the current commit and its parent commit.

One can see what Parent1 references in the diff view itself:

But I don't see any web URL which could help reference that diff. Hence my initial Azure DevOps Git API that I proposed before.



来源:https://stackoverflow.com/questions/59533905/azure-devops-compare-two-commits-right-in-the-web-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!