GIT-DELETE-SQUASHED-BRANCHES(1)
π git-delete-squashed-branches(1) π
okay bestie, welcome to git-delete-squashed-branches, a little script from the Git Extras collection and honestly? it's giving cleanup queen energy β¨
πΈ NAME πΈ
git-delete-squashed-branches β delete branches that were squashed π§Ήπ
like, literally the branch equivalent of clearing out your camera roll. no cap.
π¦ SYNOPSIS π¦
git-delete-squashed-branches [--proceed, -p] [<branch-name>]
that's it. that's the whole vibe. optional flag, optional branch name, infinite inner peace π«Ά
β¨ DESCRIPTION β¨
Deletes all git branches that have been "squash-merged" into branch-name.
so if you squashed a whole pile of work down into one commit and merged it, those old branches are just... sitting there. haunting the place. this command evicts them. iconic behavior honestly π
π OPTIONS π
--proceed,-pβ proceed with the next branch even if the current branch cannot be deleted (e.g. because it is checked out in a worktree). so if one branch refuses to go, you just keep it moving and handle the rest. respect the boundary, skip the drama π<branch-name>β the target branch where the "squashed-merged" branches were committed to. if no value is given, then the current checked out branch will be used. so yes, you can be lazy about it and it'll just assume you mean wherever you're standing rn π
π EXAMPLES π
delete everything that got squashed into whatever branch you're on right now
$ git delete-squashed-branches
Delete all branches that were "squash-merged" into the current checked out branch. easy. no thoughts, just cleanup πΈ
or be specific and aim at main
$ git delete-squashed-branches main
Delete all branches that were "squash-merged" into the main branch. This will checkout the target branch and leave you on said branch after the command has completed.
β οΈ heads up bestie β this one moves you. it checks out the target branch and you stay there afterward. so don't be surprised when you look up and you're on main. that's not a glitch, that's the plan πβ¨
π AUTHOR π
Written by Teddy Katz <teddy.katz@gmail.com> and Vladimir Jimenez <me@allejo.io>
two absolute legends. we stan. ππ
π REPORTING BUGS π
<https://github.com/tj/git-extras/issues>
found something cursed? drop it there, they'll fix it. fr fr π
π§ SEE ALSO π§
<https://github.com/tj/git-extras>
the whole git-extras cinematic universe. go explore, it slays π
lowkey reminder: this page is for git-delete-squashed-branches, section 1, coming out of Git Extras, dated May 2026. that's the whole footer situation, folded up all cute at the bottom like a little bow π
bye bestie, go delete some branches πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: git-extras 7.5.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms