diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink index 47058a8..498762c 100644 --- a/git/gitconfig.symlink +++ b/git/gitconfig.symlink @@ -78,6 +78,10 @@ # Kaleidoscope commands dkal = difftool -y -t Kaleidoscope remotes = remote -v + + # check out a local copy of a PR. https://gist.github.com/gnarf/5406589 + pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" + pr-clean = "!git for-each-ref refs/heads/pr/* --format='%(refname)' | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done" [color] diff = auto status = auto