mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Add command to prune (upstream gone).
parent
fdb604729e
commit
553a095288
1 changed files with 14 additions and 0 deletions
|
@ -147,6 +147,20 @@ customCommands:
|
|||
description: "prune local branches that have been merged to master"
|
||||
```
|
||||
|
||||
## Pruning branches no longer on the remote.
|
||||
|
||||
Implementation inspiration [here on Stackoverflow](https://stackoverflow.com/a/33548037/2081835). Basically, delete all the branches displaying `(upstream gone)`.
|
||||
|
||||
```yml
|
||||
customCommands:
|
||||
- key: "G"
|
||||
command: |
|
||||
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done
|
||||
context: "localBranches"
|
||||
description: "Prune local branches no longer on its remote; (G)one."
|
||||
loadingText: "Pruning gone..."
|
||||
```
|
||||
|
||||
## committing via [Commitizen](https://commitizen-tools.github.io/commitizen/) (`cz c`)
|
||||
|
||||
```yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue