mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-26 21:51:05 +01:00
fix(git): move squash-merged branch deletion from gbda
to gbds
function (#11991)
This commit is contained in:
parent
b696288337
commit
8152dc673b
2 changed files with 6 additions and 3 deletions
|
@ -250,7 +250,8 @@ receive further support.
|
||||||
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. |
|
| `git_develop_branch` | Returns the name of the “development” branch: `dev`, `devel`, `development` if they exist, `develop` otherwise. |
|
||||||
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. |
|
| `git_main_branch` | Returns the name of the main branch: `main` if it exists, `master` otherwise. |
|
||||||
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
|
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
|
||||||
| `gbda` | Deletes all merged and squash-merged branches |
|
| `gbda` | Deletes all merged branches |
|
||||||
|
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
||||||
|
|
||||||
### Work in Progress (WIP)
|
### Work in Progress (WIP)
|
||||||
|
|
||||||
|
|
|
@ -128,11 +128,13 @@ alias gba='git branch --all'
|
||||||
alias gbd='git branch --delete'
|
alias gbd='git branch --delete'
|
||||||
alias gbD='git branch --delete --force'
|
alias gbD='git branch --delete --force'
|
||||||
|
|
||||||
# Copied and modified from James Roeder (jmaroeder) under MIT License
|
|
||||||
# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish
|
|
||||||
function gbda() {
|
function gbda() {
|
||||||
git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null
|
git branch --no-color --merged | command grep -vE "^([+*]|\s*($(git_main_branch)|$(git_develop_branch))\s*$)" | command xargs git branch --delete 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
# Copied and modified from James Roeder (jmaroeder) under MIT License
|
||||||
|
# https://github.com/jmaroeder/plugin-git/blob/216723ef4f9e8dde399661c39c80bdf73f4076c4/functions/gbda.fish
|
||||||
|
function gbds() {
|
||||||
local default_branch=$(git_main_branch)
|
local default_branch=$(git_main_branch)
|
||||||
(( ! $? )) || default_branch=$(git_develop_branch)
|
(( ! $? )) || default_branch=$(git_develop_branch)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue