Get the loc by each filetype in a git repo
I wanted to see how much of each language I had in my repo so had to come up with this, hope it helps!
git ls-files |
perl -pe "s/.*\.(.*?)\n/\.\1\n/" |
awk '/\..*/' | sort | uniq |
xargs -n1 -E '\n' -I % sh -c 'git ls-files "*%" | xargs cat | echo "$(wc -l) %"' |
sort -rn
Written by Tim Anema
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#