mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
fix(git): fix alphabetical function ordering
This commit is contained in:
parent
507138ff06
commit
40f8353eb0
1 changed files with 11 additions and 12 deletions
|
|
@ -23,7 +23,6 @@ function git_develop_branch() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Get the default branch name from common branch names or fallback to remote HEAD
|
# Get the default branch name from common branch names or fallback to remote HEAD
|
||||||
function git_main_branch() {
|
function git_main_branch() {
|
||||||
command git rev-parse --git-dir &>/dev/null || return
|
command git rev-parse --git-dir &>/dev/null || return
|
||||||
|
|
@ -50,17 +49,6 @@ function git_main_branch() {
|
||||||
return 1
|
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() {
|
function grename() {
|
||||||
if [[ -z "$1" || -z "$2" ]]; then
|
if [[ -z "$1" || -z "$2" ]]; then
|
||||||
echo "Usage: $0 old_branch new_branch"
|
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'
|
||||||
alias gbD='git branch --delete --force'
|
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() {
|
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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue