Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the base branch of a pull request?

I created a pull request on project on GitHub to a specific remote branch. After some time, the remote branch was deleted.

How can I change the pull request to point to another branch (specifically master)?

like image 435
Marcos Vinícius da Silva Avatar asked Apr 09 '12 23:04

Marcos Vinícius da Silva


People also ask

What is base branch in Git pull request?

Base Branch: The "Base Branch" is the branch where your new changes should be applied / integrated into. Head Branch: The "Head Branch" is the branch that contains the changes you want to integrate. Title: A short title that describes what this Pull Request is about.

How do I change my source branch?

AFAIK, you cannot change the source branch after creating a Pull Request. You have to create a new one instead. For future reference, the established best practice is to create a new branch before making any commits. You should not commit directly to master, especially when contributing to team projects.

Can you modify pull request?

To edit a pull request, select the pull request on the Pull requests page, go to its detail page and click "Edit". The target branch (the base branch) and the pull request branch (the branch that will be merged) cannot be changed.


1 Answers

Updated: as Michael notes below, this is now possible:

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.

Click the Edit button by the title of the pull request to reveal the base branch selector.

An animated example of how to change a pull request's base branch.


Old answer

You can't. Just make a new pull request.

like image 139
Amber Avatar answered Oct 07 '22 07:10

Amber