Skip to content

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.

gitsweeper demo

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