libgit2 is a portable, pure C implementation of the Git core methods provided as a
re-entrant linkable library with a solid API, allowing you to write native
speed custom Git applications in any language which supports C bindings.
In the current Git project, though a libgit.a file is produced it is
not re-entrant (it will call die() on basically any error)
and it has no stable or well-designed public API. As there is no good
way to link to this effectively, a new library was needed that fulfilled
these requirements. Thus libgit2.
libgit2 is...
licensed under a very permissive license so you can use it anywhere
faster than any other Git library
written in standards compilant C99
completely multi-platform: Windows, Linux, Mac OS X, xBSD
compiled natively under all platforms (yes, even MSVC on Windows)
re-entrant, with sane error handling
designed with a solid and consistent API
available as bindings for all major scripting languages
compiled with minimal external dependencies (currently only zlib)
libgit2 is still in early development, and although it's already quite feature complete, there are no official binary releases available yet. Interested early adopters must compile the library by hand -- which is easy enough to do.
For full API documentation see the generated docs or the usage guide.
Building the library
libgit2 uses waf as its buildsystem,
and hence requires Python 2.4 or better to
configure the build. The library can be built under the following platforms:
Linux, Mac OS X, xBSD, Windows (MSVC) and Windows (MinGW).
Start by configuring the build system by running:
$ mdkir build && cd build
$ cmake ..
Then build the library
$ make
You can then test the library with:
$ make test test
And finally you can install it with (you may need to sudo):
$ make install
Once that is done, you should be able to link the library to your program
with a normal -lgit2.
Detailed build instructions for different platforms can be found in libgit2's
readme file.
Language bindings
There are already a number of language bindings in the works, so you can
use Git at native speed from your favorite programming language.
Rugged (Ruby bindings)
Rugged (previously known as Ribbit) is the reference binding implementation for libgit2, used to make sure the
C API is sane and functional. Rugged is always in sync with the libgit2 master branch. It also has the
best name for any Ruby project. Ever.
Objective-git is another set of reference bindings for libgit2. It's always in sync with the libgit2
master branch, well tested, and tastes like Cocoa.
pygit2 are the Python 2.6+ bindings for libgit2 mantained by David Borowitz. They
make extensive use of common Python idioms, and also make programming Git applications fun again.
They should be (mostly) up to date with the library changes.
libgit2sharp is a set of bindings for .NET, maintained by Emeric Fermas. They should be usable
from any language that runs on the .NET runtime, including IronPython and IronRuby. How cool is
that?