Merge pull request to a different branch than default, in Github

eoinoc picture eoinoc · Feb 3, 2012 · Viewed 54.2k times · Source

A pull request comes into my repo hosted on Github. By default it is merged into the master branch.

Is there any way for me to change which branch the changes would be merged into?

Answer

maliayas picture maliayas · Aug 17, 2016

As of 15.08.2016 GitHub allows changing the target branch of a pull request via the GUI. Click Edit next to the title, then select the branch from the dropdown.

screenshot

You can now change the base branch of an open pull request. After you’ve created a pull request, you can modify the base branch so that the changes in the pull request are compared against a different branch. By changing the base branch of your original pull request rather than opening a new one with the correct base branch, you’ll be able to keep valuable work and discussion.