# rust-lang/git2-rs

libgit2 bindings for Rust

Repository: https://github.com/rust-lang/git2-rs
Canonical: https://ross.abutalabs.com/products/git2-rs
Homepage: https://docs.rs/git2
Language: Rust
License: Apache-2.0
License Family: permissive
Last push: 2026-08-21T20:27:22+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 35, longevity 100
- inputs: {"age_days": 4415, "days_push": 12, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2090, forks 451 (observed 2026-08-28T04:06:12.370646+00:00)

## What it is
git2-rs provides safe, idiomatic Rust bindings to the libgit2 C library for reading and writing git repositories. It offers automatic resource management, strong typing, and optional HTTPS/SSH network support via feature flags.

## Use cases
- programmatically read and write git repositories from Rust
- clone remote git repositories in a Rust application
- build a custom git client or tooling in Rust
- inspect commits, branches, and refs without shelling out to git
- embed git functionality in a Rust CLI or service

## When to choose
- you need fast, in-process git operations in Rust without invoking the git binary
- you want memory-safe, threadsafe bindings with automatic resource management
- you need fine-grained control over repository internals like objects, refs, and diffs

## When to avoid
- you just need to run simple git commands - shelling out to the git CLI may be simpler
- you need every libgit2 API - some bindings are still missing
- you want a pure-Rust implementation without C dependencies - consider gitoxide instead

## Facets
- artifact type: library
- maturity: stable
- function: version-control, developer-tools, sdk
- domain: version-control, developer-tools, cross-platform
- platform: rust, cross-platform, windows
- tags: libgit2, git, bindings, ffi, cargo-crate, linux, macos

## Member repositories
- rust-lang/git2-rs (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:12.370646+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:55:36.760126+00:00, confidence not recorded.
  - readme: https://github.com/rust-lang/git2-rs (fetched 2026-08-28T04:06:12.370646+00:00, sha 13a9b338c79d)
  - homepage: https://docs.rs/git2 (fetched 2026-08-29T10:35:28.766392+00:00, sha 87598de58262)
  - site_page: https://docs.rs/ (fetched 2026-08-29T10:35:28.770591+00:00, sha 602d3d4df413)
  - site_page: https://docs.rs/crate/git2/latest (fetched 2026-08-29T10:35:28.773094+00:00, sha 3c99ff97e44b)
  - site_page: https://docs.rs/crate/git2/latest/features (fetched 2026-08-29T10:35:28.775946+00:00, sha 17ea162691c1)
  - site_page: https://docs.rs/about (fetched 2026-08-29T10:35:28.780021+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T10:35:28.783025+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T10:35:28.785229+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T10:35:28.787273+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T10:35:28.789341+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
