mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-23 00:17:59 +00:00
Adding current_branch function, which can be used like: git pull origin master
This commit is contained in:
parent
15d6fa10b0
commit
33f424134e
@ -12,3 +12,11 @@ parse_git_dirty () {
|
|||||||
fi
|
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…
Reference in New Issue
Block a user