fix(git): fix alphabetical function ordering

This commit is contained in:
NunzioFornitto 2026-07-29 17:25:07 +02:00
commit 40f8353eb0

View file

@ -23,7 +23,6 @@ function git_develop_branch() {
return 1
}
# Get the default branch name from common branch names or fallback to remote HEAD
function git_main_branch() {
command git rev-parse --git-dir &>/dev/null || return
@ -50,17 +49,6 @@ function git_main_branch() {
return 1
}
function gbcopy() {
# Check if we are in a Git repository
command git rev-parse --is-inside-work-tree &>/dev/null || return
local branch
branch="$(git_current_branch)" || return
[[ -n "$branch" ]] || return 1
print -rn -- "$branch" | clipcopy
}
function grename() {
if [[ -z "$1" || -z "$2" ]]; then
echo "Usage: $0 old_branch new_branch"
@ -142,6 +130,17 @@ alias gba='git branch --all'
alias gbd='git branch --delete'
alias gbD='git branch --delete --force'
function gbcopy() {
# Check if we are in a Git repository
command git rev-parse --is-inside-work-tree &>/dev/null || return
local branch
branch="$(git_current_branch)" || return
[[ -n "$branch" ]] || return 1
print -rn -- "$branch" | clipcopy
}
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
}