Atlassian Bitbucket How To

Pull Request vs. Merge Request

When it comes to choosing a Git management tool various factors should be considered as it significantly affects the workflow.

One of the most important aspects is how collaboration is organized in this application.  Pull Request in Bitbucket and GitHub or Merge Request in GitLab are the features made for more convenient code review.  Despite different naming, these features are equivalent as they both do the same git merge command after all to merge feature branches or forks with the existing code.

You probably want to ask why you need to use a special tool for something that can be done by a git command, but convenience and efficiency are what makes a difference here:

  • You end up having a much higher quality code in your project as everyone on your team can check it and merge branches only after the code is good enough and meets your coding standards.
  • You get a well-organized process where you can leave comments and see the changes in one tool. So there’s no need to use emails and other communication channels to discuss features. It works perfectly, especially for distributed teams, no matter whether they are located – in different rooms or cities.
  • Besides, you can get some insights on how effective your team is.

Working with Pull Requests in Bitbucket

Let’s have a look at how to use pull requests in Bitbucket and what information about your team performance you can get from it.

For instance, one of your developers has just finished working on a feature in a dedicated branch and now this feature should be merged to the development branch. But first, it should be reviewed by other team members. So, he navigates to Create pull request, chooses his feature branch as Source and the development branch as Destination. Then he can add Title and Description of the pull request and choose who will be Reviewers of it or leave it without a particular reviewer.

Then a discussion of the feature begins. Each reviewer can:

  • see what files have been edited, what commits have been made;
  • see what’s been changed since they last reviewed so that there’s no need to re-review everything again;
  • add comments to the whole pull request or to a particular code line and discuss it;

  • decline a pull request or set Needs work status;
  • merge a pull request and delete the source branch if needed.

Working with Merge Requests in GitLab

Now let’s find out how to use Merge Request feature in GitLab to improve the code review process.

Navigate to Merge Requests and click New merge request. 

Choose Source branch that you want to merge and Target branch which will be the destination.

Same as Bitbucket, GitLab gives you the opportunity to choose who will review this request. It’s also possible to see the changes in edited files, the commits included in the merge request, discuss the feature and make suggestions.

When the changes are approved by reviewers click Merge to merge branches.

Insights on Your Team Performance in Bitbucket

While working in Bitbucket you can also evaluate your team performance using Awesome Graphs for Bitbucket Server add-on. It is possible to:

Improve your development process

Pull requests definitely reduce the number of bugs in the code. Such collaboration while working on the project positively affects the quality of the code your team produces. As a result, the quality of your product gets higher and your customers become much more satisfied. Besides, thanks to the detailed analysis of your team performance using Awesome Graphs for Bitbucket add-on it’s possible to improve it and increase the speed of the development process. Try it for your project!

Recommended Articles