git-pull-request icon indicating copy to clipboard operation
git-pull-request copied to clipboard

Fetching from refs/pulls instead

Open bdowling opened this issue 8 years ago • 1 comments

I'm curious why not just pull from refs/pulls/[PR#]/head instead of trying to fetch from the original contributor's branch?

This fails in cases when the remote branch was deleted or doesn't exist. As is the case for the PR 13 on this repo for example.

git fetch -fu origin refs/pulls/13/head:pr-13
git checkout pr-13

(Along lines of https://gist.github.com/gnarf/5406589)

seems like a more straightforward approach, but I'm not sure if there are nuances I don't know of behind your method.

bdowling avatar Jan 30 '17 18:01 bdowling

Simply because I didn't know about this when I wrote the tool ;-)

splitbrain avatar Feb 06 '17 10:02 splitbrain