mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
Adding current_branch function, which can be used like: git pull origin master
This commit is contained in:
parent
b549dd4999
commit
473dd3b212
1 changed files with 8 additions and 0 deletions
|
@ -12,3 +12,11 @@ parse_git_dirty () {
|
|||
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/}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue