https://github.com/gay00ung/git-branch-sweeper
Clean up merged local & remote feature branches safely (dry-run by default).
https://github.com/gay00ung/git-branch-sweeper
automation bash branch-cleanup branch-management git shell-script
Last synced: about 23 hours ago
JSON representation
Clean up merged local & remote feature branches safely (dry-run by default).
- Host: GitHub
- URL: https://github.com/gay00ung/git-branch-sweeper
- Owner: gay00ung
- License: mit
- Created: 2026-01-15T01:47:58.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-01-15T02:28:32.000Z (6 months ago)
- Last Synced: 2026-01-15T08:34:53.461Z (6 months ago)
- Topics: automation, bash, branch-cleanup, branch-management, git, shell-script
- Language: Shell
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-branch-sweeper
Safely prune merged branches (local + remote). Dry-run by default.
## Install
Download `git-branch-sweeper.sh` and make it executable:
```bash
chmod +x git-branch-sweeper.sh
````
## Usage
Dry-run:
```bash
./git-branch-sweeper.sh
```
Apply deletions:
```bash
./git-branch-sweeper.sh --apply
```
Change pattern / bases:
```bash
./git-branch-sweeper.sh --pattern "feature/*" --base main --base dev
```
Remote name:
```bash
./git-branch-sweeper.sh --remote upstream
```
Local only / Remote only:
```bash
./git-branch-sweeper.sh --local-only
./git-branch-sweeper.sh --remote-only
```
## Notes
* `--pattern` is a bash glob, not a regex.
* Remote symbolic refs like `origin/HEAD -> origin/main` are ignored.
* Protected branches are never deleted.