A PowerShell script that aggregates a filtered list of commits across multiple local Git repositories. It will sort the found commits by date and repository and then render them in tables grouped by day.
This script enables you to quickly check on what projects you worked on at what specific day. It comes in very handy if you are "abusing" Git commits for time tracking.
The script will recusively find all Git repositories within a given -directory
. If the optional -directory
param is omitted it will fallback to the current directory "."
.
The script will find both bare and non-bare Git repositories. It follows the convention, that bare repository directories are suffixed with a .git
.
Info: Git repositories come in two flavors: Either bare or non-bare. For bare repository the $GIT_DIR
is the <directory>
itself. For non-bare repository the $GIT_DIR
is in the sub directory <directory>/.git
.
The commits can be filtered by a specific author pattern (regular expression) with the -author
param. If the optional -author
param is omitted it will fallback to match every author ".*"
.
The commits can be filtered to a specific time range -since
param. If the optional -since
param is omitted it will fallback to match every commit since "1 month ago"
.
The found commits will be sorted by date and repository and then grouped by day.
Download and unpack the latest release to your machine.
Open a PowerShell console at the location of the unpacked release and execute the ./list_git_commits.ps1.
Execute the following to list all commits of all authors that have been made within the last month across all repositories in the current working directory.
.\list_git_commits.ps1
Execute the following to list all commits of "John Doe" that have been made within the last seven days across all repositories in the current working directory.
.\list_git_commits.ps1 -author "John Doe" -since "1 week ago"
Execute the following to list all commits of all authors since January 2019 that have been made in a specific non-bare Git repository.
.\list_git_commits.ps1 -directory "../workspace/list_git_commits" -since "2019-01-01"