Created
May 18, 2017 07:06
-
-
Save phako/5769beecec3c8f73ccfcb00312a41de0 to your computer and use it in GitHub Desktop.
Github PR handling aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
pr-fetch = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1; }; f" | |
pr = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f" | |
pr-merge = "!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git merge pr/$1 --no-ff --edit -m 'Merge pull request #'$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