Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cherry-pick a pull request into a branch? [duplicate]

Tags:

git

I need to get the changes from a pull request which isn't yet merged into a branch.

I could cherry-pick each commit from the branch but there are quite a few of them. Is there a quicker way to get all the changes from a pull request?

In case it makes a difference Im using Github.

like image 481
Evanss Avatar asked Dec 07 '15 12:12

Evanss


People also ask

Does cherry pick duplicate commits?

The reason why you should use cherry-pick rarely is that it easily creates "duplicate" commits: when you integrate a commit into your HEAD branch using cherry-pick, Git has to create a new commit with the exact same contents. It is, however, a completely new commit object with its own, new SHA identifier.

Can I raise 2 pull requests from same branch?

There can be only one open PR from a given branch.

How do you cherry pick a commit from another branch in VS?

Right-click the branch containing the changes you want and select View History.... Right-click the commit you want to cherry-pick and select Cherry-pick. Visual Studio copies the changes made in that commit into a new one on your current branch.


1 Answers

If the pull request is from a branch that is contained in your repository, as RedX noted, you can follow the instructions in this post.

On the other hand, if the pull request is from someone's fork of your repository, you'll first have to add their repository as a remote, pull in their branches, then cherry-pick as described in the post above.

like image 192
houtanb Avatar answered Oct 10 '22 11:10

houtanb