mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-22 05:40:08 +00:00
Moving current_branch() to git plugin
This commit is contained in:
parent
89bd2bf317
commit
27904c117c
2 changed files with 10 additions and 9 deletions
|
@ -11,12 +11,3 @@ parse_git_dirty () {
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Will return the current branch name
|
|
||||||
# Usage example: git pull origin $(current_branch)
|
|
||||||
#
|
|
||||||
function current_branch() {
|
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
|
||||||
echo ${ref#refs/heads/}
|
|
||||||
}
|
|
||||||
|
|
|
@ -17,5 +17,15 @@ alias gcp='git cherry-pick'
|
||||||
# Git and svn mix
|
# Git and svn mix
|
||||||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
||||||
|
|
||||||
|
#
|
||||||
|
# Will return the current branch name
|
||||||
|
# Usage example: git pull origin $(current_branch)
|
||||||
|
#
|
||||||
|
function current_branch() {
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||||
|
echo ${ref#refs/heads/}
|
||||||
|
}
|
||||||
|
|
||||||
|
# these aliases take advangate of the previous function
|
||||||
alias ggpull='git pull origin $(current_branch)'
|
alias ggpull='git pull origin $(current_branch)'
|
||||||
alias ggpush='git push origin $(current_branch)'
|
alias ggpush='git push origin $(current_branch)'
|
||||||
|
|
Loading…
Reference in a new issue