Have you ever wondered how many lines you have developed in the past month? There is an easy way to calculate it using cloc.

CLOC (“Count Lines Of Code”) is simple tool that can be used together with git ls-files. Under Ubuntu it can be installed with sudo apt-get install cloc and then used as follows:
cloc $(git ls-files) which is equivalent to git ls-files | xargs cloc

The output will be similar to this:

$ cloc $(git ls-files)
75 text files.
73 unique files.
58 files ignored.

http://cloc.sourceforge.net v 1.60 T=0.17 s (99.1 files/s, 42907.5 lines/s)
---------------------------------------------------------------------------
Language                 files          blank        comment           code
---------------------------------------------------------------------------
C++                          9            571            694           4727
C/C++ Header                 6             64             67            897
make                         1             51             15            242
IDL                          1              2              0             27
---------------------------------------------------------------------------
SUM:                        17            688            776           5893
---------------------------------------------------------------------------

NOTE: cloc . will return higher numbers than cloc $(git ls-files) because it will include files ignored by Git. If you want to use cloc independently from Git, there is the possibility to fine-tune its behavior by excluding a comma-separated list of directory:
cloc --exclude-dir=legacy,build

Source: Stackoverflow