How would you get a count of all the files currently in a git repository?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can get a count of all tracked files in a git respository by using the following command:
Command Breakdown:
git ls-filescommand by itself prints out a list of all the tracked files in the repository, one per line.|operator funnels the output from the preceding command into the command following the pipe.wc -lcommand calls the word count (wc) program. Passing the-lflag asks it to return the total number of lines.Note: This returns a count of only the tracked files in the repository meaning that any ignored files or new & uncommitted files will not be counted.