15

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.

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
Evanss
  • 23,390
  • 94
  • 282
  • 505

1 Answers1

11

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.

Community
  • 1
  • 1
houtanb
  • 3,852
  • 20
  • 21
  • For example, if we have multiple commits in a pull request and after merging the pull request, can we cherry-pick the same pull request in other branches? – Rashid May 24 '21 at 13:12
  • you cherry-pick commits not pull requests. – houtanb May 24 '21 at 17:06
  • I can see it is available in GitLab but not in Bitbucket which I am using. Reference: https://docs.gitlab.com/ee/user/project/merge_requests/cherry_pick_changes.html – Rashid May 25 '21 at 08:07