Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Function that return local branches list order by date #986

Closed
wants to merge 3 commits into from

2 participants

This page is out of date. Refresh to see the latest.
Showing with 10 additions and 0 deletions.
  1. +10 −0 plugins/git/git.plugin.zsh
View
10 plugins/git/git.plugin.zsh
@@ -54,6 +54,16 @@ function current_branch() {
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
alias ggpull='git pull origin $(current_branch)'
compdef ggpull=git
Something went wrong with that request. Please try again.