𤔠Delete git branches in batches
In daily development, we create a git branch function every time we make a requirement. Over time, many local and online branches will be accumulated. Then it is particularly important to have a tool to delete git branches in batches at this time. GBKILL is a tool created to solve this need, allowing you to delete git branches more efficiently
This tool will list the
git branchesin the projects, and then you canselect in batchesthegit branchesthat need to be deleted.
𤔠Install
Actually you don't need to install it to use it! Just use the following command:
$ npx gbkill Or you can install it:
$ npm i -g gbkill šļø Usage
Enter
gbkillin yourterminal** (currently not compatible with Git in Windows terminal)**.gbkillwill execute thegit commandto scan thegit branchesunder your current project s and display them in the lists
| Key | Description | 
|---|---|
| Space | Press the spacebarto execute themergedbranch deletion (recommendation: to prevent accidental deletion) | 
| Tab | Press the Tabto execute `merged | 
| RightArrow | Press {% raw %} ->to execute `Open | 
| ā | Press {% raw %} āto select branch | 
| ā | Press āto select branch | 
Hint
The
mergelisted on the gbkill interface displaysyesorNowhich is judged bygit branch --merged <name>. You can specify the merged branch name by executinggbkill --merged <name>
When the
mergestatus ingbkillisyes, butNO_FORCE...fully mergedappears when you delete the branch. Reason:The code of this branchis not merged into thecurrently focused branch. Requiresforced deletion
When executing
gbkill --sync, theremote branchof the target branch will be deleted first and then thelocal branch
šļø Parameter
Configurable parameters of
gbkill. Some configuration parameters will be cached and shared globally in the/user home directory/.gbkillfile.
| Argument | Description | Cache | 
|---|---|---|
| –force | Forcibly delete a branch, equivalent to git branch -D <name>(Caution: localcommitchanges will be deleted) | No | 
| –sync | Whether to delete remote branches synchronously | No | 
| –merged <name> | Specify the branch name used to determine whether a branch has been merged (git branch –merged <name>) | Yes | 
| –lock <names..> | Lockedsome branches will behidden in the list, and the data will be accumulated instead of replaced (Prevent accidental deletion, protect some branches) | Yes | 
| –unlock <names..> | Unlocka branch locked by--lock | Yes | 
šļø State of Git branch
Description corresponds to branch status.
| Status | Description | Color | 
|---|---|---|
| NONE | The branch is in a normal state | |
| DELETING | Branch is being deleted | š | 
| DELETED | Branch deleted | š¢ | 
| FAILED | Fail to delete branch | š“ | 
| NO_MERGED | The branch was not merged into name branch(--merged <name>) | š£ | 
| NO_FORCE | This branch needs to be forcibly deleted git branch -D name(--force) | š” | 
| NO_SYNC | Fail to delete remote branches synchronously | š | 
šļø Known issues
ā ļø
Git for Windows Terminalis currently not supported, and the tool is limited to ink. We will look for alternatives later. Please useCMD,Vscode terminal's Git...terminal
āŗ Other
- This tool will be continuously optimized. If you have better āinteractive behaviorā or āfeature requestsā, you can submit a āprā or āissueā to me
- Thank you for using this tool and looking forward to your [issue](https://github.com/AKclown/gbkill/issues)or[PR](https://github.com/AKclown/gbkill/pulls)
 
                    
