From 32770092f5921b28003aed3cf4f40e893415f989 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 11 Dec 2018 15:24:23 +0300 Subject: [PATCH] .gitconfig: Add aliases for fetching/cleaning pull requests --- .gitconfig | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5