Skip to content

Instantly share code, notes, and snippets.

@beddari
Forked from gnarf/..git-pr.md
Created August 1, 2014 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beddari/f7f6fb1d8ad80b9760ff to your computer and use it in GitHub Desktop.
Save beddari/f7f6fb1d8ad80b9760ff to your computer and use it in GitHub Desktop.
[alias]
pr = "!f() { git fetch -fu origin refs/pull/$1/head:pr/$1; } ; f"
prr = "!f() { git fetch -fu $1 refs/pull/$2/head:pr/$2; } ; f"
pru = "!f() { git fetch -fu upstream refs/pull/$1/head: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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment