Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
8152dc67
Unverified
Commit
8152dc67
authored
Oct 18, 2023
by
Marc Cornellà
Committed by
GitHub
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(git): move squash-merged branch deletion from `gbda` to `gbds` function (#11991)
parent
b6962883
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
README.md
plugins/git/README.md
+2
-1
git.plugin.zsh
plugins/git/git.plugin.zsh
+4
-2
No files found.
plugins/git/README.md
View file @
8152dc67
...
...
@@ -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_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. |
|
`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)
...
...
plugins/git/git.plugin.zsh
View file @
8152dc67
...
...
@@ -128,11 +128,13 @@ alias gba='git branch --all'
alias
gbd
=
'git branch --delete'
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
()
{
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
)
((
!
$?
))
||
default_branch
=
$(
git_develop_branch
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment