How can I fetch an unmerged pull request for a branch I don't own?

后端 未结 13 1578
北荒
北荒 2020-11-27 10:55

I need to pull in a specific pull request (that hasn\'t been processed into the main stream yet) in the NServiceBus repo:

https://github.com/johnsimons/NServiceBus/c

13条回答
  •  鱼传尺愫
    2020-11-27 11:30

    If you just want to add one unmerged Pull Request from some other repo, to your own, there is no need for all complications (as mostly shown in other answers).

    Instead just go into your own repo and pull in the commit (from PR source), using its commit hash.

    git pull https://bitbucket.org/SomeUser/SomeProjectRepo/commits/c15...db2
    

    Doing it this way, you will just have a bunch of new edited files, as if you had edited them yourself. It's then up to you if you want to commit these with some tag/label.

    If you then want to push all news up to your own GitHub repo, just do as always:

    git commit -m "Added something by Anonymous"
    git push -u origin master
    

提交回复
热议问题