diff --git a/modules/home-manager/gitconfigs/alias.conf b/modules/home-manager/gitconfigs/alias.conf index 8394779..65b98d3 100644 --- a/modules/home-manager/gitconfigs/alias.conf +++ b/modules/home-manager/gitconfigs/alias.conf @@ -26,4 +26,7 @@ sync = "!f() { \ target_branch=${1:-main}; \ remote=${2:-origin}; \ git fetch $remote $target_branch:$target_branch; \ -}; f"; \ No newline at end of file +}; f"; +clean-branches = "!f() { \ + git for-each-ref --format '%(refname:short)' refs/heads| grep -v 'master\\|main' | xargs git branch -D ; \ +}; f";