I've encountered batching problems with git ls-files | xargs wc -l
when dealing with large numbers of files, where the line counts will get chunked out into multiple total
lines.
Taking a tip from question Why does the wc utility generate multiple lines with "total"?, I've found the following command to bypass the issue:
wc -l $(git ls-files)
Or if you want to only examine some files, e.g. code:
wc -l $(git ls-files | grep '.*\.cs')