by pmcollins · 4y ago · 0 comments
$ cat ~/bin/git-pr
#!/bin/sh
if [ $# -lt 1 ]; then
exit -1
fi
git fetch origin refs/pull/$1/head:pr/$1
So I can run `git pr <number>` to get `pr/<number>` branch created locally that I can checkout to. $ gh pr checkout {<number> | <url> | <branch>} fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*
This has to be done in each repository you have checked out locally, but maybe it is possible to also have this done globally. But I never tried to do it.[0] http://tiborsimko.org/github-local-handling-of-pull-requests...