vsts code pr

Manage pull requests.

Commands

vsts code pr abandon Abandon a pull request.
vsts code pr complete Complete a pull request.
vsts code pr create Create a pull request.
vsts code pr list List pull requests.
vsts code pr policies Manage pull request policy.
vsts code pr policies list List policies of a pull request.
vsts code pr policies queue Queue an evaluation of a policy for a pull request.
vsts code pr reactivate Reactivate an abandoned pull request.
vsts code pr reviewers Manage pull request reviewers.
vsts code pr reviewers add Add one or more reviewers to a pull request.
vsts code pr reviewers list List reviewers of a pull request.
vsts code pr reviewers remove Remove one or more reviewers from a pull request.
vsts code pr set-vote Vote on a pull request.
vsts code pr show Get the details of a pull request.
vsts code pr update Update a pull request.
vsts code pr work-items Manage work items associated with pull requests.
vsts code pr work-items add Link one or more work items to a pull request.
vsts code pr work-items list List linked work items for a pull request.
vsts code pr work-items remove Unlink one or more work items from a pull request.

vsts code pr abandon

Abandon a pull request.

vsts code pr abandon --id
[--detect {off, on}]
[--instance]

Required Parameters

--id

ID of the pull request to abandon.

Optional Parameters

--detect

Automatically detect instance. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

vsts code pr complete

Complete a pull request.

vsts code pr complete --id
[--detect {off, on}]
[--instance]

Required Parameters

--id

ID of the pull request to complete.

Optional Parameters

--detect

Automatically detect instance. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

vsts code pr create

Create a pull request.

vsts code pr create [--auto-complete]
[--bypass-policy]
[--bypass-policy-reason]
[--delete-source-branch]
[--description]
[--detect {off, on}]
[--instance]
[--merge-commit-message]
[--open]
[--project]
[--repository]
[--reviewers]
[--source-branch]
[--squash]
[--target-branch]
[--title]
[--transition-work-items]
[--work-items]

Optional Parameters

--auto-complete

Set the pull request to complete automatically when all policies have passed and the source branch can be merged into the target branch.

--bypass-policy

Bypass required policies (if any) and completes the pull request once it can be merged.

--bypass-policy-reason

Reason for bypassing the required policies.

--delete-source-branch

Delete the source branch after the pull request has been completed and merged into the target branch.

--description -d

Description for the new pull request. Can include markdown. Each value sent to this arg will be a new line. For example: --description "First Line" "Second Line".

--detect

Automatically detect instance, project, repository, source and target branches if these values are not specified. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

--merge-commit-message

Message displayed when commits are merged.

--open

Open the pull request in your web browser.

--project -p

Name or ID of the team project.

--repository -r

Name or ID of the repository to create the pull request in.

--reviewers

Additional users or groups to include as reviewers on the new pull request. Space separated.

--source-branch -s

Name of the source branch. Example: "dev".

--squash

Squash the commits in the source branch when merging into the target branch.

--target-branch -t

Name of the target branch. If not specified, defaults to the default branch of the target repository.

--title

Title for the new pull request.

--transition-work-items

Transition any work items linked to the pull request into the next logical state. (e.g. Active -> Resolved).

--work-items

IDs of the work items to link to the new pull request. Space separated.

vsts code pr list

List pull requests.

vsts code pr list [--creator]
[--detect {off, on}]
[--include-links]
[--instance]
[--project]
[--repository]
[--reviewer]
[--skip]
[--source-branch]
[--status {abandoned, active, all, completed}]
[--target-branch]
[--top]

Optional Parameters

--creator

Limit results to pull requests created by this user.

--detect

Automatically detect instance and project. Default is "on".

accepted values: off, on
--include-links

Include _links for each pull request.

--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

--project -p

Name or ID of the project.

--repository -r

Name or ID of the repository.

--reviewer

Limit results to pull requests where this user is a reviewer.

--skip

Number of pull requests to skip.

--source-branch -s

Limit results to pull requests that originate from this source branch.

--status

Limit results to pull requests with this status.

accepted values: abandoned, active, all, completed
--target-branch -t

Limit results to pull requests that target this branch.

--top

Maximum number of pull requests to list.

vsts code pr reactivate

Reactivate an abandoned pull request.

vsts code pr reactivate --id
[--detect {off, on}]
[--instance]

Required Parameters

--id

ID of the pull request to reactivate.

Optional Parameters

--detect

Automatically detect instance. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

vsts code pr set-vote

Vote on a pull request.

vsts code pr set-vote --id
--vote {approve, approve-with-suggestions, reject, reset, wait-for-author}
[--detect {off, on}]
[--instance]

Required Parameters

--id

ID of the pull request.

--vote

New vote value for the pull request.

accepted values: approve, approve-with-suggestions, reject, reset, wait-for-author

Optional Parameters

--detect

Automatically detect instance. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

vsts code pr show

Get the details of a pull request.

vsts code pr show --id
[--detect {off, on}]
[--instance]
[--open]

Required Parameters

--id

ID of the pull request.

Optional Parameters

--detect

Automatically detect instance. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

--open

Open the pull request in your web browser.

vsts code pr update

Update a pull request.

vsts code pr update --id
[--auto-complete {off, on}]
[--bypass-policy {off, on}]
[--bypass-policy-reason]
[--delete-source-branch {off, on}]
[--description]
[--detect {off, on}]
[--instance]
[--merge-commit-message]
[--squash {off, on}]
[--title]
[--transition-work-items {off, on}]

Required Parameters

--id

ID of the pull request.

Optional Parameters

--auto-complete

Set the pull request to complete automatically when all policies have passed and the source branch can be merged into the target branch.

accepted values: off, on
--bypass-policy

Bypass required policies (if any) and completes the pull request once it can be merged.

accepted values: off, on
--bypass-policy-reason

Reason for bypassing the required policies.

--delete-source-branch

Delete the source branch after the pull request has been completed and merged into the target branch.

accepted values: off, on
--description -d

New description for the pull request. Can include markdown. Each value sent to this arg will be a new line. For example: --description "First Line" "Second Line".

--detect

Automatically detect instance. Default is "on".

accepted values: off, on
--instance -i

VSTS account or TFS collection URL. Example: https://myaccount.visualstudio.com.

--merge-commit-message

Message displayed when commits are merged.

--squash

Squash the commits in the source branch when merging into the target branch.

accepted values: off, on
--title

New title for the pull request.

--transition-work-items

Transition any work items linked to the pull request into the next logical state. (e.g. Active -> Resolved).

accepted values: off, on