Skip to content

git-clean

Usage
git-clean [-h] [-f]

Deprecated: use git-sweep. Prints a notice on stderr, then runs git-sweep --local-only, which keeps git-clean’s old scope (it never touched remote branches) with git-sweep’s merge detection. Branches are now also deleted when fully merged, not only when their remote branch is gone, and rebase and squash merges count as merged.

Not the built-in git clean, which deletes untracked files.

-h, --help Show help message
-f, --force Passed on as git-sweep --force
0 Cleanup complete
1 A branch could not be deleted
2 Unknown option or unexpected argument
Terminal window
git-clean --force
git-clean

Dependencies: git-sweep

Classification: network, destructive