https://github.com/shoenig/keep-branches
Prune local git repository of unwanted branches
https://github.com/shoenig/keep-branches
branch feature-branch git prune repository
Last synced: 4 months ago
JSON representation
Prune local git repository of unwanted branches
- Host: GitHub
- URL: https://github.com/shoenig/keep-branches
- Owner: shoenig
- License: mpl-2.0
- Created: 2022-11-24T15:40:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-25T12:07:12.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T03:34:51.325Z (about 1 year ago)
- Topics: branch, feature-branch, git, prune, repository
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# keep-branches

`keep-branches` is a CLI tool used to prune local git repository of unwanted branches.
The tool will prune branches that are
- not `main`
- not the current branch
- not listed as an argument
[](LICENSE)
## Install
The `keep-branches` tool is available to download from the [Releases](https://github.com/shoenig/keep-branches/releases) page.
It is pre-compiled for many operating systems and architectures including
- Linux
- Windows
- MacOS
- FreeBSD
- OpenBSD
## Build
The `keep-branches` command can be compiled from source using the Go tool chain.
Short version:
```shell
go install github.com/shoenig/keep-branches@latest
```
## Examples
Keep only `main`
```shell
keep-branches
```
Keep `main`, `x-my-branch`, `x-foo-branch`
```shell
keep-branches x-my-branch x-foo-branch
```
Print help message
```shell
keep-branches -help
```
## Contributing
The `github.com/shoenig/keep-branches` command is always improving with new
features and bug fixes. For contributing please file an issue or pull request.
## License
The `github.com/shoenig/keep-branches` command is open source under the [MPL 2.0](LICENSE) license.