Created
October 29, 2015 17:30
-
-
Save devlead/6a283af60a655b498edd to your computer and use it in GitHub Desktop.
Example working with git log in PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get last 100 log entries as a PowerShell object | |
$gitHist = (git log --format="%ai`t%H`t%an`t%ae`t%s" -n 100) | ConvertFrom-Csv -Delimiter "`t" -Header ("Date","CommitId","Author","Email","Subject") | |
# Now you can do iterate over each commit in PowerShell, group sort etc. | |
# Example to get a commit top list | |
$gitHist|Group-Object -Property Author -NoElement|Sort-Object -Property Count -Descending | |
# Example do something for each commit | |
$gitHist|% {if ($_.Author -eq "Mattias Karlsson") {"Me"} else {"Someone else"} } |
@monahancj glad you found it useful.
Yup, this rocks, thanks for putting this out here.
thanks , simple and fast.
Thank you!
Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This was handy. Thanks.