Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nekonenene/git-branch-delete-merged
Delete local branches that have been merged (includes "Squash and merge")
https://github.com/nekonenene/git-branch-delete-merged
cli git github go golang
Last synced: about 7 hours ago
JSON representation
Delete local branches that have been merged (includes "Squash and merge")
- Host: GitHub
- URL: https://github.com/nekonenene/git-branch-delete-merged
- Owner: nekonenene
- Created: 2023-08-19T23:44:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-23T15:46:33.000Z (about 1 year ago)
- Last Synced: 2023-09-05T04:18:09.994Z (about 1 year ago)
- Topics: cli, git, github, go, golang
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-branch-delete-merged
This CLI app deletes local branches that have been merged **also "[Squash and merge](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/about-pull-request-merges#squash-and-merge-your-commits)"**.
## Installation
```sh
go install github.com/nekonenene/git-branch-delete-merged@v1
```## Usage
### General usage
If you want to delete a branch that has merged into the `main` branch:
```sh
git-branch-delete-merged --base-branch main
```And if the branch to delete exists, you will get a prompt like this:
```
Target branches: [dev1]Are you sure to delete 'dev1' branch? [y|n|l|d|q|help]:
```Please type one and press enter.
* `y`: Yes, delete the branch
* `n`: No, skip deleting
* `l`: Show git logs of the branch
* `d`: Show the latest commit of the branch and its diff
* `q`: Quit immediately
* `h`: Show help### Skip prompt
If you want to delete all merged branches without confirmation, `--yes` option will be useful.
```sh
git-branch-delete-merged --base-branch main --yes
```## Thank you
[not-an-aardvark/git-delete-squashed](https://github.com/not-an-aardvark/git-delete-squashed) is the reference code that helps finding branches which has squashed and merged.