gitsweeper¶
A CLI tool for cleaning up merged git branches.
gitsweeper identifies remote branches that have already been merged into your main branch — including squash-merged branches that simpler tools miss — and helps you delete them safely.

Why this tool exists¶
gitsweeper is a modern Go rewrite of the Python-based git-sweep, which has been unmaintained since 2016. Beyond replacing an abandoned tool, gitsweeper adds squash-merge detection — in real-world testing, ~24% of safely-deletable branches were only findable via the deeper diff-based check.
See Motivation for the full story.
Quick start¶
# Install (Linux / macOS)
curl -sSfL https://raw.githubusercontent.com/petems/gitsweeper/master/install.sh | sh
# See which remote branches have been merged
gitsweeper preview
# Delete them
gitsweeper cleanup
For other installation methods see Installation.
Where to go next¶
-
Run your first
previewandcleanupin 60 seconds. -
Reference for every CLI option, with examples.
-
How
gitsweeperfinds branches that other tools miss. -
Why
gitsweepermixesgo-gitwith shell-outs togit.
Project links¶
- Source: github.com/petems/gitsweeper
- Releases: GitHub releases
- License: MIT