Created
March 4, 2026 00:53
-
-
Save ngbrown/27d98089a88fd2d04d6d9495c578fe3f to your computer and use it in GitHub Desktop.
Find commits with large modified files, for example because of formatting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| git log --pretty=format:"%H - %ad :" --date=format:"%a %b %d %T %Y %z" | while read line; do commit_hash=$(echo $line | cut -d' ' -f1); commit_date=$(echo $line | cut -d' ' -f3-); commit_size=$(git show --format=format: --stat $commit_hash --diff-filter=M -- . ':!**/package-lock.json' ':!**/*.Generated.cs' ':!**/*_.pb.ts' ':!**/*.Designer.*' | tail -1 | awk '{print $4}'); echo "$commit_date 0$commit_size $commit_hash"; done | sort -nr --field-separator=' ' --key=8 | head -20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment