A simple and interactive CLI tool to help you delete Git branches with ease.
- Lists all local Git branches.
- Allows selection of branches to keep using arrow keys and TAB.
- Displays a confirmation screen to review and confirm your selections before deleting branches.
- Provides a
--forceflag to delete unmerged branches usinggit branch -D.
Note: This script only deletes branches from your local machine. Remote branches are not affected.
The script depends on fzf for interactive selection. If fzf is not already installed, the installation script will attempt to install it for you.
To install the delete-branches script run the following command:
curl -s https://raw.githubusercontent.com/denny351/delete-branches/main/install.sh | bash- Navigate to the root of your Git repository.
- Run the script:
delete-branches [--force]
- Follow the interactive steps:
- Use arrow keys and
TABto select branches to keep. - Press
ENTERto confirm your selection. - Review the confirmation screen and type
yesto proceed ornoto cancel.
- Use arrow keys and
To uninstall the delete-branches script and optionally remove fzf, run the following command:
curl -s https://raw.githubusercontent.com/denny351/delete-branches/main/uninstall.sh | bashThis project is licensed under the MIT License. See the LICENSE file for details.