Add a full script version of git-sweep
with a smidge more resilience
This commit is contained in:
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
|
Reference in New Issue
Block a user