libgit2: a Git Linkable Library
One of the long running issues with Git is that the library produced to run the binary is not re-entrant – you can’t link to it from another program because…
One of the long running issues with Git is that the library produced to run the binary is not re-entrant – you can’t link to it from another program because it calls die()
all over the place. Thus, anyone trying to write a GUI or web interface or script for Git has always had to fork/exec a call to the actual Git binary, which is slow and often a poor API (having to parse the text output).
A few years ago Shawn Pearce started a new Git library designed and licensed to be linkable and called it libgit2. This was a great idea, but nobody really ran with it and not much was done on it for several years. Fortunately this year a student choose it for their Google Summer of Code project and for better or worse got me as their mentor.
Well, that student did an amazing job taking the library from being basically unusable to being incredibly useful. His name is Vicent Marti and GitHub has taken over where the GSoC organization left off and has contracted Vicent to continue his great work on libgit2 and its Ruby bindings, the Rugged library.
The projects are still in a bit of flux, but there is quite a lot you can do now and there are bindings for Python in addition to Ruby. If you are interested in using it for something and have any features you would like to see, add an issue to our GitHub project. You can read more about libgit2 at its new website: libgit2.github.com.
A little about Vicent: Vicent Marti is a 20 year old developer born and raised in the Catalan Countries. He is currently working towards his Masters Degree in Computer Science while living in Helsinki (Finland) and trying to cope with the fact that water comes in shapes and forms other than “liquid; in the Mediterranean”. When he’s not working on anything related to indie videogames, he enjoys evangelizing about Git and being an asshole about it.
Written by
Related posts

Racing into 2025 with new GitHub Innovation Graph data
Discover the latest trends and insights on public software development activity on GitHub with the quarterly release of data for the Innovation Graph, updated through December 2024.

GitHub Availability Report: March 2025
In March, we experienced one incident that resulted in degraded performance across GitHub services.

Vibe coding with GitHub Copilot: Agent mode and MCP support rolling out to all VS Code users
In celebration of MSFT’s 50th anniversary, we’re rolling out Agent Mode with MCP support to all VS Code users. We are also announcing the new GitHub Copilot Pro+ plan w/ premium requests, the general availability of models from Anthropic, Google, and OpenAI, next edit suggestions for code completions & the Copilot code review agent.