For this question, xargs will help you to count the number of lines in a git repository.
Let’s see how this works
git ls-files | xargs cat | wc -l
For more information you better use
git ls-files | xargs wc -l
This will count the number of lines in a git repository.