Browse Source

Adding current_branch function, which can be used like: git pull origin master

master
Robby Russell 15 years ago
parent
commit
33f424134e
  1. 8
      lib/git.zsh

8
lib/git.zsh

@ -12,3 +12,11 @@ parse_git_dirty () { @@ -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…
Cancel
Save