Browse code

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

Robby Russell authored on 25/11/2009 at 20:45:16
Showing 1 changed files
... ...
@@ -12,3 +12,11 @@ parse_git_dirty () {
12 12
   fi
13 13
 }
14 14
 
15
+#
16
+# Will return the current branch name
17
+# Usage example: git pull origin $(current_branch)
18
+#
19
+function current_branch() {
20
+  ref=$(git symbolic-ref HEAD 2> /dev/null) || return
21
+  echo ${ref#refs/heads/}
22
+}