AZD: Create a pull request
AZD creates pull requests in an editor-like tab of the AZD Pull Requests tool window. The tab title is New Pull Request at followed by the organization and the Azure DevOps project, for example New Pull Request at contoso/Fabrikam.
Open the new pull request tab
Start a new pull request
In the title bar of the AZD Pull Requests tool window, click Create Pull Request… (+). When the tool window has the focus, you can also press Alt+Insert (macOS: ā N).
Right-click a file or the editor, then select .
After you push a branch, click Create a pull request in the push notification. If a pull request already exists for the branch, the notification offers Open pull request details instead.
Fill in and create the pull request
Create a pull request
Check the branches in the header of the tab. The header reads
repository:target ← repository:source. By default, the source is your current branch and the target is the default branch of the repository. To change a side, click it, select the Head repository and the Branch, then click Save.Review the commits of the pull request in the commits list.
Enter a Title. By default, the title is the name of your current branch. To generate a title, click the AI button in the field; see AZD: Generate titles, descriptions and commit messages. If you leave the title empty, AZD uses the name of the source branch.
Edit the Description.
If Auto-fill description from PR templates is selected and the repository has a template, AZD fills in the description from it; see Use pull request templates. Otherwise, it lists the commit messages. The counter under the field shows the length; Azure DevOps accepts up to 4000 characters.
Type
!to reference another pull request, or#to reference a work item, and select it from the completion list; see Mention people, pull requests and work items.Optional: next to Add reviewers, click the pencil icon and select reviewers.
Optional: next to Work items to link, click the pencil icon and select work items. If the name of your current branch contains work item numbers, for example
feature/1234-login, AZD selects the matching work items from the list when the tab opens. By default, the list offers work items that are assigned to you and match the options in Boards and Work Items.Optional: next to Add labels, select labels. To add a label that does not exist yet, click +, enter it in the Add Custom Label dialog and click OK. You can set labels only when you create the pull request.
Click Create Pull Request. To create a draft instead, click the arrow on the button and select Create Draft Pull Request. When the pull request is created, the tab shows its details; see AZD: Review a pull request.
If the source branch exists only locally, AZD opens the Pull Request Branch dialog. Confirm the Remote branch name; AZD pushes the branch and then creates the pull request.
To publish a draft later, see Publish a draft or mark as draft.
Use pull request templates
Azure DevOps repositories can store description templates. To use them in AZD, select Auto-fill description from PR templates in . The option is off by default.
AZD looks for a default template in these locations, in this order:
.azuredevops/pull_request_template.md or .azuredevops/pull_request_template.txt
.vsts/pull_request_template.md or .vsts/pull_request_template.txt
docs/pull_request_template.md or docs/pull_request_template.txt
pull_request_template.md or pull_request_template.txt in the repository root
AZD also uses branch-specific templates from a pull_request_template/branches folder in any of these locations.
Messages in the new pull request tab
- Pull Request already exists
An active pull request already uses the same branches. Click View to open it.
- No changes between 'target' and 'source'
The source branch has no commits that the target branch lacks.
- Unable to create pull request from 'source' to 'target'
The source branch is your local copy of the target branch. Select a different source branch, such as your feature branch.
- Commits will be pushed to the protected branch
Creating the pull request would push commits to a protected branch. Check the source branch before you continue.