Last Updated: February 25, 2016
· mlafeldt

Get churn counts for Git repository

I've found this gem - git-churn - while browsing Gary Bernhardt's dot files:

The script can show you the churn counts for an entire Git repo or specific files/directories in it.

As an example, I ran git-churn against the Linux kernel to get the top 10 most modified files:

$ cd linux/
$ git describe
$ git churn | tail -n10
746     arch/x86/kvm/x86.c
779     net/core/dev.c
804     drivers/net/tg3.c
807     drivers/net/wireless/iwlwifi/iwl-agn.c
848     arch/arm/Kconfig
871     include/linux/sched.h
898     drivers/gpu/drm/i915/intel_display.c
1068    sound/pci/hda/patch_realtek.c
1359    kernel/sched.c

Last but not least, in case you prefer Git aliases (like I do):