Is there an Azure CLI (azure repos pr, etc ) command that will show if there are any commits not merged into a target branch?

Lance Lyons 86 Reputation points
2023-10-03T14:59:59.68+00:00

Are there any Azure CLI commands that will return information about PR branches that have commits not merged into target branch. I am working through some automation and need to determine if there are any commits on a PR branch that have not been committed to the target branch.

In azure devops (ADO) when you start to create a PR, it will show you the number of files and commits like the image below. I am trying to determine if there are files or commits like this image shows 1.

I tried these but could not see anything related in the return

azure repos pr show

Azure repos pr create

Thanks in advance.

azuregit

Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
258 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 12,041 Reputation points
    2023-10-04T01:44:59.0566667+00:00

    @Lance Lyons - Thanks for reaching out to us.

    Here is the list of Azure Repo PR command list that might be helpful for you :

    https://learn.microsoft.com/en-us/cli/azure/repos/pr?view=azure-cli-latest#az-repos-pr-list(azure-devops)

    https://learn.microsoft.com/en-us/cli/azure/reference-docs-index?view=azure-cli-latest#az-repos

    Hope this helps. and please feel free to reach out if you have any further questions.


    If the above response was helpful, please feel free to "Accept as Answer" and click "Yes" so it can be beneficial to the community.