Skip to content

Instantly share code, notes, and snippets.

@littlelazer
Forked from thetristan/git-fresh
Created May 24, 2012 18:10
Show Gist options
  • Save littlelazer/2783198 to your computer and use it in GitHub Desktop.
Save littlelazer/2783198 to your computer and use it in GitHub Desktop.
Quick shell script to check the freshness of your git branches
#!/bin/bash
#
# Place this file somewhere in your path and make it executable
# Can then be ran within any repo by calling `git fresh` within that folder
#
(
for b in `git branch | sed 's:^[ *]*::'`
do
git log -n 1 $b -- | sed -e '4,$ d' -e '1,2 d' -e "s^Date:[ ]*^^" -e "s^\(.*\)$^\1 ~~~ ${b}^"
done
) | sort -k 5,5nr -k 2,2Mr -k 3,3nr -k 4,4nr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment