Counting lines in GitHub repository

cloc can also count the codes written in different files in the GitHub repository. Now let’s clone cloc GitHub repository. To count the number of lines in the GitHub repo the following command:

cloc commit

First, clone the repository and use the cloc.

git clone https://github.com/AlDanial/cloc
cd cloc
cloc ec44eb0

cloc provide many other options. To know more about the cloc read the man page of cloc.

man cloc


CLOC – Count number of lines of code in file

cloc is a command-line-based tool. It counts the blank lines, comment lines, actual code lines written in many programming languages. cloc is completely written in the Perl language, and it has no external dependencies. cloc can run on many operating systems like Linux, macOS, Windows, OpenBSD and many more.

Similar Reads

Installation of cloc

Now let’s see how we can install the cloc on different operating systems. Use one of the following commands according to your operating system:...

Using cloc on compressed file

cloc can also count the number of lines physical, commented, an empty line written in different languages in compressed files...

Get count of each file

To get the line of code count file-wise in folder or zip file use the –by-file option with the cloc command....

Counting lines in GitHub repository

cloc can also count the codes written in different files in the GitHub repository. Now let’s clone cloc GitHub repository. To count the number of lines in the GitHub repo the following command:...