diff --git a/gitconfig b/gitconfig index 39b78a2..be48358 100644 --- a/gitconfig +++ b/gitconfig @@ -59,7 +59,6 @@ [alias] hug = blame lograph = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' - sweep = !git branch --merged $([[ $1 != \"-f\" ]] && git rev-parse master) | egrep -v \"(^\\*|^\\s*(master|develop)$)\" | xargs git branch -d [commit] template = ~/.gittemplate diff --git a/local/bin/git-sweep b/local/bin/git-sweep new file mode 100755 index 0000000..6d8447c --- /dev/null +++ b/local/bin/git-sweep @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +git branch --merged "$([[ "${1}" != "-f" ]] && git rev-parse HEAD)" | + grep -Ev '(^\*|^\s*(main|master|develop)$)' | + while read -r branch_name; do + git branch -d "${branch_name}" + done