Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding current_branch function, which can be used like: git pull orig…

…in master
  • Loading branch information...
commit 473dd3b2121ae0e54803098a7fde4b4c1e673145 1 parent b549dd4
@robbyrussell robbyrussell authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/git.zsh
View
8 lib/git.zsh
@@ -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/}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.