# libgit2

8 Hacker News commenters recommended libgit2 and 7 criticized it, November 2025 to November 2026. It was recommended in 6 of 13 months.

**Verdict:** Free library for working with git repositories from your own code, with broad functionality. Common caveat: not feature complete, and one benchmark found it slower than the git CLI.

## Why people recommend it

- Sane, linkable library with broad functionality (2 comments): "that's a linkable library that gives you a lot of functionality when working with git repos" ([source](https://news.ycombinator.com/item?id=48470715)) "libgit2 seems very sane and shouldn't be terribly hard to make something usable out of it" ([source](https://news.ycombinator.com/item?id=47328280))
- Praised as awesome and great (3 comments): "both Gitoxide (Rust) and libgit2 are both better, they're just not feature complete" ([source](https://news.ycombinator.com/item?id=48470896)) "Gitoxide and libgit2 are both awesome but they are not feature complete." ([source](https://news.ycombinator.com/item?id=48470689)) "It's great but it's not feature complete" ([source](https://news.ycombinator.com/item?id=48470705))

## What people warn about

- Not feature complete (3 comments): "both Gitoxide (Rust) and libgit2 are both better, they're just not feature complete" ([source](https://news.ycombinator.com/item?id=48470896)) "Gitoxide and libgit2 are both awesome but they are not feature complete." ([source](https://news.ycombinator.com/item?id=48470689)) "It's great but it's not feature complete" ([source](https://news.ycombinator.com/item?id=48470705))
- Slower than git CLI (2 comments): "Bun's attempted to integrate with libgit2 instead of spawning calls to the git CLI and found it to be consistently 3x slower" ([source](https://news.ycombinator.com/item?id=47619783)) "Across the board the C library was 3x slower than just spawning calls to the git CLI" ([source](https://news.ycombinator.com/item?id=47619666))
- Tricky to use, full of footguns (2 comments): "Having built a service on top of libgit2, I can say that there are plenty of tricky aspects to using the library" ([source](https://news.ycombinator.com/item?id=47619700)) "libgit2 is full of footguns" ([source](https://news.ycombinator.com/item?id=47621159))

## Alternatives hackers recommend

- [Gitoxide](https://hackerapproved.com/p/gitoxide.md): 13 recommend
- [Grit Git rewrite in Rust](https://hackerapproved.com/p/grit.md): 7 recommend
- [ziggit](https://hackerapproved.com/p/ziggit.md): 6 recommend

## Cite as

Hacker Approved, "libgit2", https://hackerapproved.com/p/libgit2/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
