Understanding Github PR Merge Options

Posted on

Source control an extremely important tool for software developers to understand how to utilize. Today, that often includes git as the version control tool and Github as the hosting platform.

GitHub PR Merge Options

About a year ago, Github introduced two new options to integrate a pull request into a base branch.

Those options include Squash and Merge in addition to Rebase and Merge.

GitHub pull request merge options


Both of these options remove a lot of manual effort to accomplish a cleaner, more concise history in your mainline branch.

git at Ibotta

Ibotta’s engineering team has grown from 15 to 55 in the last year. With that massive growth, we’ve hired a wide variety of developers at different levels of familiarity with git(hub).

With our growth, we’ve started to enforce squashing PR commits upon merge to our upstream branch. I’ve spoken in the past about the benefits of squashing commits into concise, meaningful commits and now Github supports this right through the UI.

However, many of my teammates had questions about why we’re using the Squash and Merge strategy so, as part of the Ibotta Technology Lunch and Learn series, I presented how the three Github merge options work, stepping through a detailed explanation of each strategy.

I also discuss some gotcha with rewriting history in git, and present a few additional git tools that are helpful to be familiar with (git add -p, git revert and git bisect).

This material is intended to be helpful for novice and experienced practitioners alike.

The Video

The Slides

If you prefer to read the content, you can find the slides on Github or on Slideshare.

More Resources

If you want more in-depth information on interactive rebasing, you might be interested in the first version of this talk given in December 2015. You can view the slides or the video.

Find an issue?
Open a pull request against my blog on GitHub.
Ben Limmer