From: Oleg Broytman Date: Tue, 11 Dec 2018 12:24:23 +0000 (+0300) Subject: .gitconfig: Add aliases for fetching/cleaning pull requests X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=32770092f5921b28003aed3cf4f40e893415f989;p=dotfiles.git .gitconfig: Add aliases for fetching/cleaning pull requests --- diff --git a/.gitconfig b/.gitconfig index 8c2f040..8b2f479 100644 --- a/.gitconfig +++ b/.gitconfig @@ -178,6 +178,9 @@ 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