DEV Community

Cover image for GitHub Pull Request Auto-Merge EXPLAINED
Davide 'CoderDave' Benvegnù
Davide 'CoderDave' Benvegnù

Posted on

GitHub Pull Request Auto-Merge EXPLAINED

GitHub recently announced the possibility to automatically merge a Pull Request into the main branch. Let's see how.

Intro

Today I will show you how to use the brand new Pull Request auto-merge feature recently announced from GitHub and why I think it is pretty useful.

PR Merge slide

Right now when you submit a pull request on on GitHub you often have to spend a lot of time waiting for approval, status checks to complete, etc.

And then you gotta remember to check back in so that you can actually have the code merged. And if you forget to do that, or if you wait a day or two, sometimes even other changes come in and you have to redo your pull request.

This new feature basically lets the developer submit a Pull Request to a code base and mark it to be automatically merged in when approved and all the checks have passed.

Video

Alright, let's see how to enable and use it.

This is much easier to see and explain with a demo:

(Link to the video: https://youtu.be/Igx8w95cakU)

Conclusions

Of course this is totally optional, but it is a significant time savings and improving experience. And there is a way for repo admins or org admins to disable it if they don't want their PRs to be automatically merged.

What do you think of this new feature? Are you going to use it? I think it is pretty cool, and if you are like me, working with teams distributed through different timezone, it is gonna save time because if I have to wait for other people to approve my PRs I often then forget to merge them manually.

Let me know in the comments below!

Top comments (2)

Collapse
 
fakerr profile image
Walid Berrahal

This is awesome! I work a lot with stacked PRs and having this auto-merge feature combined with a status check like Dpulls will be extremely usefull if I want to merge all PRs in the dependency chain at once.

Collapse
 
aeryk profile image
Aeryk

I've enabled auto merge feature, but still it's not working for me