If you want to look back on recent work to remind yourself what changed, git
log
serves well. If you have multiple git repos to look at, you may want an
easier way to check all the repos together.
$script:RepoRoot = "$(pwd)"; Get-ChildItem -Directory | ForEach-Object {echo ""; echo $_.Name; cd $_.Name; git log --oneline --graph --decorate --all --since "1 week ago" --author "My Name"; cd $script:RepoRoot }
Run this from the parent directory that contains all your repositories.
Explanation
-
$script:RepoRoot = "$(pwd)"
store the current directory so we can come back here after looking in each repo. -
Get-ChildItem -Directory
list all the directories -
... | ForEach-Object { echo ""; echo $_.Name; ... }
for each object returned by...
, print a new line and print the directory name, then do some more stuff -
cd $_.Name
change directory into the repo -
git log --oneline --graph --decorate --all --since "1 week ago" --author "My Name"
print a one line summary of each log entry made in the last week by me- We have an alias for the
--oneline --graph --decorate --all
which prints the log with the colors and formatting we prefer, but I didn’t show that here. This set of options is a good starting point for a simple oneline git log. -
--since "1 week ago"
accepts many English date phrases, both absolute and relative -
--author "My Name"
accepts email or name and matches as long as the commit author contains the string
- We have an alias for the
-
cd $script:RepoRoot
go back to the start to prepare for the next iteration
Usage
After running the script, you can scroll through to see an overview of the changes across all of your repos.