Commit 473dd3b2 authored by Robby Russell's avatar Robby Russell
Browse files

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

parent b549dd49
......@@ -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/}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment