# Count the line of codes

4 messages from 2009-02-06 to 2009-02-06. Participants: zyk, Johannes Gilger, Matthieu Moy, Jakub Narebski.
Thread: https://gitlist.dev/t/17603

## zyk, 2009-02-06 07:55

Subject: Count the line of codes
Message-ID: <21868069.post@talk.nabble.com>
URL: https://gitlist.dev/e/21868069.post%40talk.nabble.com

```

Does anyone know if there is any tools available for counting the line of
codes in the project using GIT?

How to count the code changes on the specific branch?
How to count the delta lines between one tag and its successive tag?
-- 
View this message in context: http://www.nabble.com/Count-the-line-of-codes-tp21868069p21868069.html
Sent from the git mailing list archive at Nabble.com.

```

## Johannes Gilger, 2009-02-06 08:23

Subject: Re: Count the line of codes
Message-ID: <gmgs1u$lsv$1@ger.gmane.org>
URL: https://gitlist.dev/e/gmgs1u%24lsv%241%40ger.gmane.org
In-Reply-To: <21868069.post@talk.nabble.com>

```
On 2009-02-06, zyk <zhengyuk@hotmail.com> wrote:
>
> Does anyone know if there is any tools available for counting the line of
> codes in the project using GIT?

wc -l *.c *.h for example would count the lines of all c-files and 
their headers.

> How to count the code changes on the specific branch?
> How to count the delta lines between one tag and its successive tag?

git diff tag~..tag --stat

Greetings,
Jojo

-- 
Johannes Gilger <heipei@hackvalue.de>
http://hackvalue.de/heipei/
GPG-Key: 0x42F6DE81
GPG-Fingerprint: BB49 F967 775E BB52 3A81  882C 58EE B178 42F6 DE81

```

## Matthieu Moy, 2009-02-06 12:50

Subject: Re: Count the line of codes
Message-ID: <vpqy6wjg24s.fsf@bauges.imag.fr>
URL: https://gitlist.dev/e/vpqy6wjg24s.fsf%40bauges.imag.fr
In-Reply-To: <gmgs1u$lsv$1@ger.gmane.org>

```
Johannes Gilger <heipei@hackvalue.de> writes:

> On 2009-02-06, zyk <zhengyuk@hotmail.com> wrote:
>>
>> Does anyone know if there is any tools available for counting the line of
>> codes in the project using GIT?
>
> wc -l *.c *.h for example would count the lines of all c-files and 
> their headers.

wc for the total number of lines in files, or
http://www.dwheeler.com/sloccount/ to get the number of lines of code
(excluding blank lines and such).

-- 
Matthieu

```

## Jakub Narebski, 2009-02-06 14:08

Subject: Re: Count the line of codes
Message-ID: <m3zlgzvesp.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3zlgzvesp.fsf%40localhost.localdomain
In-Reply-To: <vpqy6wjg24s.fsf@bauges.imag.fr>

```
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> Johannes Gilger <heipei@hackvalue.de> writes: 
>> On 2009-02-06, zyk <zhengyuk@hotmail.com> wrote:
>>>
>>> Does anyone know if there is any tools available for counting the line of
>>> codes in the project using GIT?
>>
>> wc -l *.c *.h for example would count the lines of all c-files and 
>> their headers.
> 
> wc for the total number of lines in files, or
> http://www.dwheeler.com/sloccount/ to get the number of lines of code
> (excluding blank lines and such).

Or Ohcount (OSS part of Ohloh) from http://labs.ohloh.net/ohcount

Or GitStat (but that is web-based) which you can see at work at
http://mirror.celinuxforum.org/gitstat/

Or git-statistic GSoC 2008 project http://repo.or.cz/w/git-stats.git

HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git

```
