Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge part of a pull request

New Git and Github user. Is it possible to accept/merge only part of a Pull Request?

For example if there is a Pull Request on Github that has 4 commits but you only want to use 2 of them, is there a way to simply merge the 2 and disregard the other 2?

like image 454
JasonDavis Avatar asked Mar 26 '13 17:03

JasonDavis


People also ask

Can you merge part of a pull request?

No, the pull request is all or nothing. You can recreate the pull request by making a branch up to only the commits you need and merge that.

How do you merge changes from a pull request?

To accept the pull request, click the Pull Requests tab to see a summary of pending pull requests. If you are happy with the changes, click Merge Pull request to accept the pull request and perform the merge. You can add in a comment if you want. Once you click Merge Pull request, you will see a button Confirm merge.

How do I merge pull request branches?

Under your repository name, click Pull requests. In the "Pull Requests" list, click the pull request you'd like to merge. Depending on the merge options enabled for your repository, you can: Merge all of the commits into the base branch by clicking Merge pull request.

What does it mean to merge pull request?

A pull request – also referred to as a merge request – is an event that takes place in software development when a contributor/developer is ready to begin the process of merging new code changes with the main project repository.


1 Answers

No, the pull request is all or nothing.

You can recreate the pull request by making a branch up to only the commits you need and merge that.

You can do this via

git cherry-pick

Or

git rebase -i
like image 157
sjakubowski Avatar answered Sep 29 '22 12:09

sjakubowski