]> git.phdru.name Git - dotfiles.git/commitdiff
.gitconfig: Add aliases for fetching/cleaning pull requests
authorOleg Broytman <phd@phdru.name>
Tue, 11 Dec 2018 12:24:23 +0000 (15:24 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 11 Dec 2018 12:24:23 +0000 (15:24 +0300)
.gitconfig

index 8c2f04054602eeaf5879f5b76feb30e0198a8537..8b2f47915e05fc1843e6e248ded629be72f48c41 100644 (file)
        sw = show --word-diff --decorate
        unstage = reset HEAD --
 
+       pr = "!f() { git fetch ${2:-upstream} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
+       clean-pr = "!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"
+
 [branch]
        autosetuprebase = always