Create a pull request

When you are ready to start a discussion about your code changes in Bitbucket Data Center, it's time to create a pull request. A pull request is a dedicated forum for discussing proposed changes to a project. To create a pull request you'll need a feature branch that you've made changes to.

To create a pull request:

  1. Select Create pull request in the sidebar.
  2. Choose the source tag or branch and the destination branch. The source branch is where you made your code changes and the destination is the branch you want to merge to. The source and target branches may be located in different forks:

     
     
  3. Use the Diff and Commits tabs to compare the source and destination branches before creating the pull request.
  4. Select either Create pull request or Continue, and enter a title and description that will help people understand what your pull request is about. By default, the pull request title will contain the commit message or branch name. The description will populate with any existing commit history if no description template is being used in the project or repository.
    Use mentions (to notify another user), and markdown (to add formatting) in your description. If there are contributor guidelines available, have a look to make sure you're complying with the repository's owner's rules.
  5. Add individual reviewers or reviewer groups – users will receive a notification by email. Others who have project permissions can participate in the discussion if it interests them.
  6. Select Create.

You will receive email notifications when your reviewers and other participants comment on the pull request or commit changes to it. 


Edit a pull request

After creating a pull request, you can modify it by clicking Edit on the pull request's page. You can edit details such as the TitleDescription, and Reviewers. In particular, you can change the Destination branch for the pull request – you'll need Read permission on the branch you want to set.


Pull request description templates

Who can do this?

Project and repository admins

Available in Bitbucket Data Center 7.13 onwards

By default, pull request descriptions automatically populate with a list of relevant commit message history. The Description field is how pull request authors can set the context for a code review by adding images, links, or provide instructions for reviewers. Having a custom template for your pull request descriptions in Bitbucket Data Center will save time and help reviewers know what to expect while doing code reviews.

Numbered list

To create a custom description template:

  1. Go to Repository or Project settings > Description template.
  2. (Repository only) From the Project settings inheritance, select Use custom settings.
  3. From Template behavior, select Create a custom description template.
  4. Fill out the Description field with the default information or leave it empty to set an empty description value for your template.
  5. Save your changes.

To inherit the project level template description:

  1. Go to Repository settings > Description template.
  2. From Project settings inheritance, select Inherit from the project settings.
  3. Save your changes.

The default description template will automatically be populated into the description field on the Create pull request page. If you don't want to use a template for the description, you can set the Template behavior toggle to Use the commit history as the default description on the Pull request description template page.

Last modified on Jan 29, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.