Just another programming blog

HowTo, Tips&Tricks

List most often modified files in GIT repository

Why would I need that?

Why I find that useful? It often helps me recognizing classes that potentially have too much responsibility in the project without even looking into details - those tend to be changed more often than others (check Large Class and Divergent Change code smells).

// Note: this is just an indicator that may lead you towards conclusions mentioned above, not necesarily a prophecy.

How?

Bash

Command

git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -10

Example output:

Powershell

Command

git log --pretty=format: --name-only | Group-Object -NoElement | Sort-Object -Property Count -Descending | Select-Object -First 10 | Format-Table -AutoSize

Example output

Summary

Hope it's going to be useful for you as well.

Leave a Reply