Skip to content

Instantly share code, notes, and snippets.

@johnny-bit
Created June 10, 2020 19:52
Show Gist options
  • Save johnny-bit/0b34a8bb00e92d9461f7497ead8edfe6 to your computer and use it in GitHub Desktop.
Save johnny-bit/0b34a8bb00e92d9461f7497ead8edfe6 to your computer and use it in GitHub Desktop.
[alias]
pr = "!f() { git fetch -fu ${2:-upstream} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
pr-clean = "!git checkout master ; 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