Add a full script version of git-sweep
with a smidge more resilience
This commit is contained in:
parent
0390fdb43d
commit
5ddd23b1d0
@ -59,7 +59,6 @@
|
|||||||
[alias]
|
[alias]
|
||||||
hug = blame
|
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)'
|
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]
|
[commit]
|
||||||
template = ~/.gittemplate
|
template = ~/.gittemplate
|
||||||
|
6
local/bin/git-sweep
Executable file
6
local/bin/git-sweep
Executable file
@ -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
|
Loading…
Reference in New Issue
Block a user