az-repos
Manage Azure DevOps repos. tldr-pages
On several platforms
Several platforms
Manage Azure DevOps repos. Part of azure-cli (also known as az).
List all repos in a specific project
az repos list --project project_nameIdentifyAdd policy on a specific branch of a specific repository to restrict basic merge
az repos policy merge-strategy create --repository-id repository_id_in_repos_list --branch branch_name --blocking --enabled --allow-no-fast-forward false --allow-rebase true --allow-rebase-merge true --allow-squash trueIdentify--repository-idId of the repository on which to apply the policy Azure CLI extensions reference--branchBranch on which this policy should be applied. Azure CLI extensions reference--blockingWhether the policy should be blocking or not Azure CLI extensions reference--enabledWhether the policy is enabled or not Azure CLI extensions reference--allow-no-fast-forwardBasic merge (no fast-forward) - Preserves nonlinear history exactly as it happened during development. Azure CLI extensions reference--allow-rebaseRebase and fast-forward - Creates a linear history by replaying the source branch commits onto the target without a merge commit. Azure CLI extensions reference--allow-rebase-mergeRebase with merge commit - Creates a semi-linear history by replaying the source branch commits onto the target and then creating a merge commit. Azure CLI extensions reference--allow-squashSquash merge - Creates a linear history by condensing the source branch commits into a single new commit on the target branch. Azure CLI extensions referenceAdd build validation on a specific repository, using an existing build pipeline, to be triggered automatically on source update
az repos policy build create --repository-id repository_id --build-definition-id build_pipeline_id --branch main --blocking --enabled --queue-on-source-update-only true --display-name name --valid-duration minutesIdentify--repository-idId of the repository on which to apply the policy Azure CLI extensions reference--build-definition-idBuild Definition Id. Azure CLI extensions reference--branchBranch on which this policy should be applied. Azure CLI extensions reference--blockingWhether the policy should be blocking or not Azure CLI extensions reference--enabledWhether the policy is enabled or not Azure CLI extensions reference--queue-on-source-update-onlyQueue Only on source update. Azure CLI extensions reference--display-nameDisplay name for this build policy to identify the policy. Azure CLI extensions reference--valid-durationPolicy validity duration (in minutes). Azure CLI extensions referenceList all active Pull Requests on a specific repository within a specific project
az repos pr list --project project_name --repository repository_name --status activeIdentify--repositoryName or ID of the repository. Azure CLI extensions reference--statusLimit results to pull requests with this status. Azure CLI extensions reference