9

My situation is as follows: - I have a fork of an opensource github project. - I do all of my development in my forked repo in branches from the develop branch - There is an unmerged pull request I need in the main repo's develop branch - To test the unmerged pull request I created a new directory and cloned origin to it then fetched the unmerged request to the main - Now that I've tested the unmerged pull request, i need to merge the pull request with my fork of develop.

What steps will allow me to merge the pull request into my local fork?

catbadger
  • 1,662
  • 2
  • 18
  • 27

1 Answers1

22
~/your-repo $ git remote add pr-source https://github.com/<user-providing-pull-request>/<repo-name>

~/your-repo $ git fetch pr-source

~/your-repo $ git merge pr-source/<pull-request-branch-name>

Note that:

  • you don't need the main repo, either from github or cloned locally
  • you don't need a clone of the repo providing the pull request, you just need it as a remote
  • you don't have to call it pr-source, I was just using that as "pull request source"
user2926055
  • 1,963
  • 11
  • 10