merged

workflow branching

Delete local branches which have been fully merged into dev branch (excluding the dev branch itself). Useful for cleaning up completed feature branches.

From Advanced Git Aliases published by Atlassian.

Usage: git merged

CLI Command

git config --global alias.merged "!f() { git branch --merged dev | grep -v " dev$" | xargs -r git branch -d; }; f"

.gitconfig Snippet

[alias]
  merged = !f() { git branch --merged dev | grep -v " dev$" | xargs -r git branch -d; }; f