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. 

If your work is still in progress and you wouldn't like to share it with the whole team, you can create a draft pull request and then, make it ready for review when you're confident about your code.

To create a regular pull request you'll need a feature branch that you've made changes to:

  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. In the Reviewers field, mention individual team members or reviewer groups from whom you’re expecting feedback on your pull request. The added reviewers will receive an email notification about the pull request.

    If default reviewers or code owners are configured for the branches you’re working with, these people will be automatically added as reviewers to your pull request. If you wouldn’t like to share your work with all of them, remove the corresponding user tags from the field. If you remove at least one reviewer, the Default reviewers or Code owners quick add buttons respectively will appear under the field, showing you how many reviewers you can still add from each group.


    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 Sep 24, 2024

Was this helpful?

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