A small, cross-platform Go CLI that removes local branches whose upstream has been removed (e.g., branches marked as "[gone]"). Safe by default, dry-run first, and designed for Windows/macOS/Linux.
Once published, you’ll be able to install with:
-
Windows (winget)
winget install jmelosegui.git-sweep -
macOS (Homebrew Core)
brew install git-sweep
-
Linux (Debian/Ubuntu via apt)
sudo apt install git-sweep
- Go to the repository Releases page and pick a version. To use a pre-release, select a tag labeled “Pre-release”.
- Download the archive matching your OS/arch:
- linux:
git-sweep_<version>_linux_amd64.tar.gz(or_arm64) - macOS:
git-sweep_<version>_darwin_amd64.tar.gz(or_arm64) - Windows:
git-sweep_<version>_windows_amd64.zip(or_arm64)
- linux:
- (Recommended) Verify checksum:
- Download
checksums.txtfrom the same release - macOS/Linux:
# Replace <version>, <os>, and <arch> with the actual values for your downloaded file. # Example for version 1.2.3 on Linux amd64: shasum -a 256 -c checksums.txt | grep git-sweep_1.2.3_linux_amd64 # Or, for your specific file: shasum -a 256 -c checksums.txt | grep git-sweep_<version>_<os>_<arch> - Windows PowerShell:
Get-FileHash .\git-sweep_<version>_windows_amd64.zip -Algorithm SHA256 # Compare against the corresponding line in checksums.txt
- Download
- Extract:
- macOS/Linux:
tar -xzf git-sweep_<version>_<os>_<arch>.tar.gz
- Windows PowerShell:
Expand-Archive .\git-sweep_<version>_windows_amd64.zip -DestinationPath .\git-sweep
- macOS/Linux:
- Move the binary into your PATH:
- macOS/Linux (example):
sudo mv git-sweep /usr/local/bin/
- Windows (example): add the extracted folder to the "Path" user environment variable, or move
git-sweep.exeinto a directory already on PATH.
- macOS/Linux (example):
- Verify:
git sweep -V
Dry-run (default):
git sweepExecute deletions (interactive confirm if TTY):
git sweep -yJSON plan output:
git sweep --json