# libgit2/libgit2 SLOC report

> As of 2026-11-21 (commit 142570e7bec0), libgit2/libgit2 contains 355,455 total lines: 213,009 code, 92,049 comments, 50,397 blank, across 834 files in 16 languages (top language: C 74.7%). Canonical public options (tests, docs and generated files excluded). Counted with tokei via OctoCounts.

libgit2/libgit2 has 213,009 source lines of code out of 355,455 total lines across 834 files, counted with tokei from the main ref at commit 142570e7bec0 on November 21, 2026. Tests, docs and generated files are excluded under OctoCounts' canonical public options.

OctoCounts produced this report by resolving libgit2/libgit2 to commit 142570e7bec0, downloading the repository source archive, and counting files selected by the effective rules with tokei, the open-source line counter written in Rust. The table below breaks the count down by programming language into files, total lines, code lines, comment lines, and blank lines, so the figures can be compared across languages and projects. Results are cached by commit, tokei version, and analysis options; an exact reproduction needs the same commit, engine version, and effective counting rules.

## Counting rules and retention

libgit2/libgit2: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.

Saved reports remain subject to cache cleanup and replacement. Export the JSON or text for durable citation; live repository URLs can change.

## Repository size insights

This is a large codebase by counted code lines. Code represents 59.9% of all lines, comments represent 25.9%, and the repository averages 255 code lines per file. C accounts for 74.7% of counted code.

| Language | Files | Lines | Code | Comments | Blanks |
| --- | ---: | ---: | ---: | ---: | ---: |
| C | 328 | 217,563 | 159,217 | 21,858 | 36,488 |
| C Header | 360 | 74,229 | 37,611 | 28,602 | 8,016 |
| SVG | 2 | 6,737 | 6,728 | 2 | 7 |
| JavaScript | 4 | 3,293 | 2,541 | 34 | 718 |
| Perl | 25 | 3,819 | 2,299 | 1,173 | 347 |
| CMake | 52 | 2,818 | 1,970 | 389 | 459 |
| Shell | 18 | 1,829 | 1,365 | 123 | 341 |
| Python | 3 | 719 | 512 | 54 | 153 |
| BASH | 18 | 369 | 245 | 52 | 72 |
| AWK | 3 | 533 | 184 | 280 | 69 |
| PHP | 1 | 197 | 159 | 25 | 13 |
| JSON | 4 | 106 | 106 | 0 | 0 |

Top language: C 74.7%. Generated on November 21, 2026. Canonical report: https://octocounts.com/github/libgit2/libgit2

## Reproduce this report

[Reproduce this exact report and configuration](https://octocounts.com/github/libgit2/libgit2/commit/142570e7bec074fd845aa654e61dcfb1d47caa60?analysis=%7B%22ignoredDirs%22%3A%5B%5D%2C%22ignoredLanguages%22%3A%5B%5D%2C%22profile%22%3A%22default%22%2C%22includeDocs%22%3Afalse%2C%22includeTests%22%3Afalse%2C%22includeGenerated%22%3Afalse%7D&reportId=7f348d9cbf067493d8f9660eff9b649d3e62260f1f65c037178092f288e89d56).

## Report FAQ

### How many lines of code does libgit2/libgit2 have?

libgit2/libgit2 has 213,009 lines of code, plus 92,049 comment lines and 50,397 blank lines, for 355,455 total lines at commit 142570e7bec0 on November 21, 2026. Tests, docs and generated files are excluded under OctoCounts' canonical public options.

### How was the libgit2/libgit2 line count measured?

OctoCounts resolved the public GitHub repository to commit 142570e7bec0, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.

### What commit was counted for libgit2/libgit2?

This OctoCounts report was generated from main at commit 142570e7bec0 on November 21, 2026.

## Related OctoCounts pages

- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Neovim vs VS Code](https://octocounts.com/compare/neovim-vs-vscode)
- [MongoDB vs PostgreSQL](https://octocounts.com/compare/mongodb-vs-postgres)
- [How to count lines of code in a GitHub repository](https://octocounts.com/docs/count-lines-of-code-github)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [OctoCounts API docs](https://octocounts.com/docs/api)
- [All OctoCounts guides](https://octocounts.com/docs)
