libgit2/1.8.1

libgit2 is a portable, pure C implementation of the Git core methods provided as a re-entrant linkable library with a solid API
Recipe info
GPL-2.0-linking-exception
2024-05-19

Available packages
Linux
Windows
macOS
macOS Apple Silicon

Install
Add the following line to your conanfile.txt:
[requires]
libgit2/1.8.1

Using libgit2

Note

If you are a new Conan user, we recommend reading the how to consume packages tutorial.

If you need additional assistance, please ask a question in the Conan Center Index repository.

Simplest use case consuming this recipe and assuming CMake as your local build tool:

[requires]
libgit2/1.8.1
[generators]
CMakeDeps
CMakeToolchain
[layout]
cmake_layout
from conan import ConanFile
from conan.tools.cmake import cmake_layout


class ExampleRecipe(ConanFile):
    settings = "os", "compiler", "build_type", "arch"
    generators = "CMakeDeps", "CMakeToolchain"

    def requirements(self):
        self.requires("libgit2/1.8.1")

    def layout(self):
        cmake_layout(self)

Now, you can run this Conan command to locally install (and build if necessary) this recipe and its dependencies (if any):

$ conan install conanfile.txt --build=missing

Useful information to take into account to consume this library:


These are the main declared targets:

  • CMake package name(s): libgit2
  • CMake target name(s): libgit2::libgit2
  • pkg-config file name(s): libgit2.pc

A simple use case using the CMake file name and the global target:

# ...
find_package(libgit2 REQUIRED)
# ...
target_link_libraries(YOUR_TARGET libgit2::libgit2)

These are all the available headers. Some of these ones might be non-public; make sure of it by visiting the libgit2 homepage listed above:

#include "git2.h"
#include "git2/annotated_commit.h"
#include "git2/apply.h"
#include "git2/attr.h"
#include "git2/blame.h"
#include "git2/blob.h"
#include "git2/branch.h"
#include "git2/buffer.h"
#include "git2/cert.h"
#include "git2/checkout.h"
#include "git2/cherrypick.h"
#include "git2/clone.h"
#include "git2/commit.h"
#include "git2/common.h"
#include "git2/config.h"
#include "git2/cred_helpers.h"
#include "git2/credential.h"
#include "git2/credential_helpers.h"
#include "git2/deprecated.h"
#include "git2/describe.h"
#include "git2/diff.h"
#include "git2/email.h"
#include "git2/errors.h"
#include "git2/experimental.h"
#include "git2/filter.h"
#include "git2/global.h"
#include "git2/graph.h"
#include "git2/ignore.h"
#include "git2/index.h"
#include "git2/indexer.h"
#include "git2/mailmap.h"
#include "git2/merge.h"
#include "git2/message.h"
#include "git2/net.h"
#include "git2/notes.h"
#include "git2/object.h"
#include "git2/odb.h"
#include "git2/odb_backend.h"
#include "git2/oid.h"
#include "git2/oidarray.h"
#include "git2/pack.h"
#include "git2/patch.h"
#include "git2/pathspec.h"
#include "git2/proxy.h"
#include "git2/rebase.h"
#include "git2/refdb.h"
#include "git2/reflog.h"
#include "git2/refs.h"
#include "git2/refspec.h"
#include "git2/remote.h"
#include "git2/repository.h"
#include "git2/reset.h"
#include "git2/revert.h"
#include "git2/revparse.h"
#include "git2/revwalk.h"
#include "git2/signature.h"
#include "git2/stash.h"
#include "git2/status.h"
#include "git2/stdint.h"
#include "git2/strarray.h"
#include "git2/submodule.h"
#include "git2/sys/alloc.h"
#include "git2/sys/commit.h"
#include "git2/sys/commit_graph.h"
#include "git2/sys/config.h"
#include "git2/sys/cred.h"
#include "git2/sys/credential.h"
#include "git2/sys/diff.h"
#include "git2/sys/email.h"
#include "git2/sys/errors.h"
#include "git2/sys/filter.h"
#include "git2/sys/hashsig.h"
#include "git2/sys/index.h"
#include "git2/sys/mempack.h"
#include "git2/sys/merge.h"
#include "git2/sys/midx.h"
#include "git2/sys/odb_backend.h"
#include "git2/sys/openssl.h"
#include "git2/sys/path.h"
#include "git2/sys/refdb_backend.h"
#include "git2/sys/reflog.h"
#include "git2/sys/refs.h"
#include "git2/sys/remote.h"
#include "git2/sys/repository.h"
#include "git2/sys/stream.h"
#include "git2/sys/transport.h"
#include "git2/tag.h"
#include "git2/trace.h"
#include "git2/transaction.h"
#include "git2/transport.h"
#include "git2/tree.h"
#include "git2/types.h"
#include "git2/version.h"
#include "git2/worktree.h"