Skip to content

Instantly share code, notes, and snippets.

@tenpn
Created October 9, 2012 08:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tenpn/3857482 to your computer and use it in GitHub Desktop.
Save tenpn/3857482 to your computer and use it in GitHub Desktop.
a very powershell-y way of getting the most unused git branches. makes an object with properties and sorts it.
git branch -r --merged develop | %{$_.trim()} | select @{n='Branch';e={$_}},@{n='LastCommit';e={[datetime](git log $_ -1 --pretty=format:%ci)}} | sort LastCommit
@tenpn
Copy link
Author

tenpn commented Oct 9, 2012

Output:
Branch DaysSinceLastCommit


origin/speed 34.0214529453032
origin/camera 32.7949343802523
origin/trackgen 26.8374606768634
origin/setpiececamera 21.5704338595984
origin/gestures 21.5041944382025

@tenpn
Copy link
Author

tenpn commented Oct 12, 2012

Now with datetimes!

Branch LastCommit


origin/speed 05/09/2012 09:58:40
origin/camera 06/09/2012 15:24:51
origin/trackgen 12/09/2012 14:23:37
origin/setpiececamera 17/09/2012 20:48:08
origin/gestures 17/09/2012 22:23:31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment