Count number of lines in a git repository
Asked 07 September, 2021
Viewed 791 times
  • 54
Votes

How would I count the total number of lines present in all the files in a git repository?

git ls-files gives me a list of files tracked by git.

I'm looking for a command to cat all those files. Something like

git ls-files | [cat all these files] | wc -l

16 Answer