libgit2 is a portable, pure C implementation of Git's core functionality, packaged as a linkable library with bindings for many languages.