Skip to content

git-clean

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

Fetches and prunes the remote, fast-forwards the current branch, and deletes local branches whose tracking remote has been deleted. Switches to main/master automatically if the current branch is orphaned.

Arguments:

-h, --help Show help message
-f, --force Force-delete unmerged orphaned branches (git branch -D)

Returns:

0 Cleanup complete
1 Argument parsing failed
Examples
git-clean --force
git-clean