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.
git ls-files
The answer by Carl Norum assumes there are no files with spaces, one of the characters of IFS with the others being tab and newline. The solution would be to terminate the line with a NULL byte.
IFS
tab
newline
git ls-files -z | xargs -0 cat | wc -l