We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b319669 commit 044e174Copy full SHA for 044e174
git.nix
@@ -8,6 +8,7 @@
8
userEmail = "git@aiotter.com";
9
10
aliases = {
11
+ delete-merged = ''!f() { git branch --merged ''${1:-master} | grep -v "^[ *]*''${1:-master}$" | xargs git branch -d; }; f'';
12
delete-squashed = ''
13
!f() { local targetBranch=''${1:-master} && git checkout -q $targetBranch && git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d && git for-each-ref refs/heads/ \"--format=%(refname:short)\" | while read branch; do mergeBase=$(git merge-base $targetBranch $branch) && [[ $(git cherry $targetBranch $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == \"-\"* ]] && git branch -D $branch; done; }; f
14
'';
0 commit comments