# AZD: Create a pull request

> For the complete documentation index, see [llms.txt](https://edgafner.github.io/llms.txt).

> **TL;DR**
> Start: Create Pull Request… (+) in the AZD Pull Requests tool window
>
>
>
> Shortcut in the tool window: `Alt+Insert` (macOS: `⌘ N`)
>
>
>
> Templates: `Settings | Version Control | AZD | Preferences`, Auto-fill description from PR templates
>
>
>
> Requires: a project with an Azure DevOps Git remote and a signed-in AZD account; see [Connect to Azure DevOps](azd-installation.html#connect)

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

Procedure: 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 `Git | Create Pull Request…`.

* 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

Procedure: Create a pull request

1. 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.

2. Review the commits of the pull request in the commits list.

3. 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](ai-title-description-generation.html). If you leave the title empty, AZD uses the name of the source branch.

4. 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](#pr-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](azd-pr-comments.html#mentions).

5. Optional: next to Add reviewers, click the pencil icon and select reviewers.

6. 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](azd-settings-configuration.html#boards-and-work-items).

7. 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.

8. 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](pull-request-details.html).

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](azd-pr-complete.html#azd_publish-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 `Settings | Version Control | AZD | Preferences`. 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.

## See also

### Related topics

[AZD: Work with pull requests](work-with-azure-devops-pull-requests.html) [AZD: Generate titles, descriptions and commit messages](ai-title-description-generation.html) [AZD: Review a pull request](pull-request-details.html) [AZD: Vote, complete and merge](azd-pr-complete.html)

### Useful resources

[Create pull requests (Microsoft Learn)](https://learn.microsoft.com/en-us/azure/devops/repos/git/pull-requests) [Pull request templates (Microsoft Learn)](https://learn.microsoft.com/en-us/azure/devops/repos/git/pull-request-templates)

