Developer bit

Git Log Heatmap

Use git log to create a heatmap of the files that have been changed the most frequently within a repository. This is useful to identify the files that most...

Git Log Heatmap

Use git log to create a heatmap of the files that have been changed the most frequently within a repository. This is useful to identify the files that most likely need a closer look. For example, the file contains too much logic and should be split up into multiple files, it contains hot code paths that change frequently, or maybe it's a file with a history of many fixes.

The following git log command returns a list of files (excluding json and lock files) that have been changed within the last 6 months, sorted by the number of changes.

git log --since 6.months.ago --pretty=format: --name-only `
| Where-Object { ![string]::IsNullOrEmpty($_) } `
| ?{$_ -notmatch ".(json|lock)$" } `
| Sort-Object `
| Group-Object `
| Sort-Object -Property Count -Descending `
| Select-Object -Property Count, Name -First 25

Feel free to update this developer bit on GitHub, thanks in advance!

Enjoying the blog?

Support my work

If you enjoyed this post and found it useful, consider supporting my work. It helps me keep creating and sharing content like this. Thank you!