Tags: #git # Get File Count for Git Repository Command: ``` git ls-files | wc -l ``` Breakdown: - The `git ls-files` command by itself prints out a list of all the tracked files in the repository, one per line. - The `|` operator funnels the output from the preceding command into the command following the pipe. - The `wc -l` command calls the [word count (wc) program](http://en.wikipedia.org/wiki/Wc_%28Unix%29). Passing the `-l` flag asks it to return the total number of lines. Source: https://stackoverflow.com/a/9468981