File: git-delete-merged-branches

package info (click to toggle)
git-extras 7.4.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 2,120 kB
  • sloc: sh: 4,312; python: 994; makefile: 146
file content (7 lines) | stat: -rwxr-xr-x 218 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
#!/usr/bin/env bash

branches=$(git branch --no-color --merged | grep -vE "^(\*|\+)" | grep -v "$(git_extra_default_branch)" | grep -v svn)
if [ -n "$branches" ]
then
    echo "$branches" | xargs -n 1 git branch -d
fi