We have workitems in DevOps that have commits linked in them.
I open the Git commit in DevOps and would like to find information about which branches contain the commit.
How can I determine the branches for this commit?
Update: the question has been edited to make more sense in the context of Git because commits may exist on multiple branches, even though Azure DevOps will only show zero or one branches for any specific commit in the UI. To see all of the branches that contain a commit as the question is currently worded, you can use the command line:
git branch --all --contains <commit-ID>
For the original wording of the question, since commits can exist on zero to many branches, it doesn't make sense to display the branch that a commit exists on. (Perhaps it would if there was only one branch that a commit existed on, but that would not be the normal case in a typical repo.)
I just confirmed in Azure DevOps that when you view a commit directly, it does not display any branch information. However, if you are viewing the history of a specific branch, and then click on a commit, you will see the branch name from which you viewed that commit, and it appears in the exact location you specified in your screenshot. If you click the same commit from multiple branches you will see different branch names there depending on which one you clicked on the commit from.
Note that when a branch is displayed, the URL has additional parameters. Here are examples without a branch displayed, and with one displayed:
commit/aa2fa1e1c344b8b79e012a2b47acf32c445e94b2
vs
commit/aa2fa1e1c344b8b79e012a2b47acf32c445e94b2?refName=refs%2Fheads%2Fmy-branch-name