Skip to content

Instantly share code, notes, and snippets.

@datengaertnerei
Created June 23, 2022 08:06
Show Gist options
  • Save datengaertnerei/8f85eb979ddcf3c224e15849b6961e46 to your computer and use it in GitHub Desktop.
Save datengaertnerei/8f85eb979ddcf3c224e15849b6961e46 to your computer and use it in GitHub Desktop.
Shell script to list the 10 most changed files of a git repo.
#!/bin/bash
tmpfile="git-count.tmp"
echo "file;count" > $tmpfile
for file in `git ls-files`
do
echo $file";"`git log --oneline $file | wc -l` >> $tmpfile
done
cat $tmpfile | sort -t';' -r -k2 -n | head -10
rm $tmpfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment