mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Function that return local branches list order by date
This commit is contained in:
parent
1120f97305
commit
392a6ca904
1 changed files with 10 additions and 0 deletions
|
|
@ -54,6 +54,16 @@ function current_branch() {
|
||||||
echo ${ref#refs/heads/}
|
echo ${ref#refs/heads/}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Will return the local branches order by date
|
||||||
|
#
|
||||||
|
function gbabydate() {
|
||||||
|
for b in `git branch --no-color 2> /dev/null | sed -e 's/*//'`;
|
||||||
|
do
|
||||||
|
echo -e `git log -1 --format=%Cgreen%ci%Creset "$b" --`\\t"$b";
|
||||||
|
done | sort
|
||||||
|
}
|
||||||
|
|
||||||
# these aliases take advantage of the previous function
|
# these aliases take advantage of the previous function
|
||||||
alias ggpull='git pull origin $(current_branch)'
|
alias ggpull='git pull origin $(current_branch)'
|
||||||
compdef ggpull=git
|
compdef ggpull=git
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue