nimgit2

libgit2 wrapper for Nim

Wrapper score 15/100 · tests present · no docs generated

Wraps a native library — check OS Compatibility below for platform-specific linking notes.

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install nimgit2
choosenim install nimgit2
git clone https://github.com/genotrance/nimgit2

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
nimgit2 - - - - - - -

Source

Repository https://github.com/genotrance/nimgit2
Homepage https://github.com/genotrance/nimgit2
Registry Source nimble_official

README

Nimgit2 is a Nim wrapper for the libgit2 library.

Nimgit2 is distributed as a Nimble package and depends on nimterop to generate the wrappers. The libgit2 source code is downloaded using Git so having git in the path is ironically required.

Installation

Nimgit2 can be installed via Nimble:

> nimble install nimgit2

This will download and install nimgit2 in the standard Nimble package location, typically ~/.nimble. Once installed, it can be imported into any Nim program.

Usage

Module documentation can be found here

import nimgit2

doAssert git_libgit2_init() > 0, "Failed to init"

Compile with -d:git2Std if libgit2 is already installed by your package manager. Use -d:git2Git or -d:git2DL if building from source or -d:git2Conan or -d:git2JBB if a pre-compiled binary is preferred. Check Conan Center or Bintray for available pre-built versions. Note that Bintray only has shared builds of libgit2 and Conan's static builds on Windows do not work with gcc.

To link a static build of libgit2, set -d:git2Static. The -d:git2SetVer=xxx can be used to set a specific tag or version. These defines can also be set in code using setDefines(). See the nimterop docs for more details.

The libgit2 docs is a good reference guide on how to use the API.

Credits

Nimgit2 wraps the libgit2 source code and all licensing terms of libgit2 apply to the usage of this package.

Feedback

Nimgit2 is a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub with an MIT license so issues, forks and PRs are most appreciated.