Tip: List-Commits
Views (4)
function List-Commits {
cd 'C:\Git'
$Commits = @()
Get-ChildItem . -Directory | % {
cd "$_"
if (Test-Path (Join-Path (Get-Location) '.git')) {
$Commits += git log --format="$($_)~%h~%ai~%s~%an" | ConvertFrom-Csv -Delimiter '~' -Header ('Project,Hash,Date,Message,Author'.Split(','))
}
cd ..
}
$Commits | ? Author -EQ "$(git config --get user.name)" | sort Date -Descending | Out-GridView -Title 'Commits'
}
This function iterates through Git repositories under the same parent folder (C:\Git in my case), builds a list of all the commits that you’ve authored (i.e. that match your user.name in Git config) and displays them in descending date order in a grid view.
Change the path in the second line to suit, or just remove it to have it search for repositories under the current directory.

I use it to remind myself what I’ve been working on over the last few days. Mostly for fun and only occasionally because I’m late filling in my timesheets… 
This was originally posted here.

Like
Report
*This post is locked for comments