4 ms·
> Don't use the merge button, just add the requester's repo as a remote to yours Actually, you don't need to do that. GitHub provides a special pulls remote "n
by justinmk 12y ago
> Don't use the merge button, just add the requester's repo as a remote to yours
Actually, you don't need to do that. GitHub provides a special pulls remote "namespace" on the upstream repo, so you can add it as a fetch pattern to your .git/config like so:
[remote "upstream"]
url = https://github.com/neovim/neovim.git
fetch = +refs/heads/*:refs/remotes/upstream/*
fetch = +refs/pull/*/head:refs/pull/upstream/*
Then when you `git fetch --all`, you will have ALL pull requests available in your local repo in the local pull/ namespace. To check out PR #42:
git checkout -b foo refs/pull/upstream/42
- Mithaldu 12y agoThat is great, and i thank you for bringing that to my, and everyone else's attention! :)
- jbish 12y agoYes! I've been wanting to do this and didn't know it was this easy.
- ChuckMcM 12y agoWow you are my new favorite person. What I was going to say was that the GP was correct in that it just took a bit more work on the maintainers part to keep the history clean, but even that is unnecessary apparently :-)
- hacknat 12y agoYou rock!
- eiopa 12y agoGood tip. It's interesting that other systems has a nicer implementation for it. In Phabricator, it's: $ arc patch D12345 and it checks out revision 12345 into an appropriately named branch.
- zak_mc_kracken 12y agoThis is... amazing. Thank you so much.
- config_yml 12y agois this documented somewhere on github?
- ben0x539 12y agoYeah, I have to google the precise path every time I need it: https://help.github.com/articles/checking-out-pull-requests-locally/ https://help.github.com/articles/checking-out-pull-requests-...
- hhaidar 12y agoWOW, this has been missing from my life for way too long! Thank you :D