Create a pull request to merge your change
- Create a repository and add a teammate
- Clone and make a change on a new branch
- Create a pull request to merge your change
- WKSP - Tutorial: Learn about Bitbucket pull requests
To alert your teammates to your updates and get their approval, your next step is to create a pull request. In addition to a place for code review, a pull request shows a comparison of your changes against the original repository (also known as a diff) and provides an easy way to merge code when ready.
Step 1. Create the pull request
You need a branch to create a pull request. Good thing you created a branch in the previous section of this tutorial.
From your repository, click + in the global (leftmost) sidebar. Then, click Create a pull request under Get to work. Bitbucket displays the request form. Make sure that you are in a repository before you click + in the global sidebar.
- Complete the form:
- You've already got an automatic Title, your last commit message.
- Add a Description if you'd like.
- From the Reviewers field, add your team member breezycloud as a reviewer.
- Click Create pull request.
Bitbucket opens the pull request and your reviewer receives an email notification with details of the pull request for them to review.
Step 2. Merge your pull request
Not so fast! You may have noticed the Merge button at the top. Before you click it, you need to wait for an approval of your changes. In addition to the email notification your teammates receive, they'll also see the pull request appear under Pull requests to review on the Your work dashboard.
From the pull request, the reviewer can view the diff and add comments to start a discussion before clicking the Approve button.
When someone approves your pull request, you'll get an email notification. Once you've got the approvals you need (in this case just one!), you can merge. From the pull request, click Merge. And that's it! If you want to see what it looks like when your branch merges with the main branch, click Commits to see the commit tree.