| ... | ... |
@@ -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 |
+} |