Automic VaultAutomic Vault

brew

使用 Homebrew, apk, dnf, MacPorts, Nix, pacman, apt, zypper 安装 libgit2

查看 libgit2 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

安装

其他安装命令

macOS

Homebrew已验证 · 100%
brew install libgit2

local Homebrew formula metadata

MacPorts已验证 · 94%
sudo port install libgit2

MacPorts ports tree · devel/libgit2/Portfile · 来源: api.github.com

Linux

Alpine Linux apk已验证 · 92%
sudo apk add libgit2

Alpine Linux edge package indexes · libgit2 · 来源: dl-cdn.alpinelinux.org

Fedora dnf已验证 · 92%
sudo dnf install libgit2

Fedora Rawhide package metadata · libgit2 · 来源: dl.fedoraproject.org

Nix已验证 · 92%
nix profile install nixpkgs#libgit2

nixpkgs package indexes · pkgs/by-name/li/libgit2/package.nix · 来源: api.github.com

Arch Linux pacman已验证 · 92%
sudo pacman -S libgit2

Arch Linux sync databases · libgit2 · 来源: geo.mirror.pkgbuild.com

Debian apt已验证 · 92%
sudo apt install libgit2-1.9

Debian stable package indexes · libgit2-1.9 · 来源: deb.debian.org

Ubuntu apt已验证 · 92%
sudo apt install libgit2-1.7

Ubuntu 24.04 LTS package indexes · libgit2-1.7 · 来源: archive.ubuntu.com

openSUSE zypper已验证 · 92%
sudo zypper install libgit2-1_9

openSUSE Tumbleweed package metadata · libgit2-1_9 · 来源: download.opensuse.org

概览

软件包摘要

C library of Git core methods that is re-entrant and linkable

历史

项目历史与用法

libgit2 is a portable C implementation of Git core methods as a re-entrant, linkable library. It became important because the original Git executable was not designed as an embeddable library, while editors, forges, desktop clients, hosting providers, and language bindings needed Git behavior inside long-running applications.

项目历史

GitHub's 2010 project announcement describes libgit2 as started by Shawn Pearce a few years earlier, then revived through a Google Summer of Code project by Vicent Marti with Scott Chacon as mentor. The immediate motivation was practical: Git's own code called die() and was not re-entrant, so GUI, web, and scripting users often had to fork and parse the Git binary.

The upstream README describes libgit2 as a portable pure-C implementation with a solid API, usable from C directly and through bindings. By 2020, maintainer Edward Thomson announced libgit2 1.0 after many years of planning and bug fixing; by late 2024 maintainers were publicly discussing planned ABI/API changes for libgit2 2.0 and SHA-256 support.

采用历史

libgit2's adoption followed the rise of Git as a developer platform rather than only a command-line tool. The upstream README says it is used by GUI clients, hosting providers, forges, utilities, and applications, with bindings for Ruby, .NET, Python, Node.js, Rust, and more.

Because it is a shared C library with many language bindings, package managers ship libgit2 as infrastructure for other packages. Its releases matter to downstreams when Git compatibility, transport security, SHA-1/SHA-256 behavior, or ABI stability changes.

使用方式

Applications use libgit2 to open repositories, inspect objects and references, read and write commits, perform network operations, and embed Git workflows without shelling out to the Git CLI.

The library is especially attractive for IDEs, Git GUI clients, web services, and language ecosystems that want native bindings. The included git2 executable is secondary; the main value is the API surface.

为什么软件包爱好者会关心

libgit2 is one of the canonical examples of turning a famous CLI tool's behavior into a stable embeddable library. For package nerds, the interesting part is not just Git support; it is ABI management, language binding compatibility, bundled-versus-system crypto and SSH choices, and the long path to a 1.0 library release.

It also explains why some packages depend on libgit2 even when Git itself is installed: they need in-process repository operations and predictable APIs, not subprocess output.

时间线

  • 2008: Shawn Pearce had started libgit2 by the period described in GitHub's 2010 announcement.
  • 2010: GitHub announced renewed libgit2 work after a Google Summer of Code effort by Vicent Marti.
  • 2020: libgit2 0.99 was released on 19 February 2020 as the project approached 1.0.
  • 2020: libgit2 1.0 was announced on 1 April 2020.
  • 2024: Maintainers stated that libgit2 v1.9 was expected to be the final v1.x release line.
  • 2025: libgit2 v1.9.2 release notes documented security fixes for external SSH execution and SSH credential creation.

Related projects

  • Git is the reference command-line system whose repository behavior libgit2 implements as a library. Rugged, pygit2, NodeGit, git2-rs, and .NET bindings are language-level entry points. GitHub, GitLab, Bitbucket-style forges, IDEs, and desktop Git clients are common application categories cited by project material.

安全态势

风险级别:绿色

library-like package without higher-risk signals.

风险分类器

绿色 风险 · 低 置信度 · appliance

原因

  • library-like package without higher-risk signals

信号

  • metadata:library-like

安装行为

  • formula 元数据中未记录 Homebrew post-install 钩子。
  • Homebrew bottle 元数据适用于 6 个平台目标。
  • 安装时包含 2 个运行时依赖。
  • 构建元数据列出 2 个构建依赖。

建议审查

在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。

可执行文件

已安装的可执行文件

命令类型暴露范围备注
git2cli全局可执行文件

新鲜度

版本和新鲜度

这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。

页面生成时间2026-07-10
管理器版本1.9.4
管理器更新时间2026-05-22
本地数据OK
上游当前
检测到的最新版本v1.9.4

https://github.com/libgit2/libgit2

  • OK没有生成新鲜度警告。

安装元数据

软件包元数据

软件包键brew:libgit2
版本1.9.4
软件包管理器Homebrew
软件包管理器页面https://formulae.brew.sh/formula/libgit2
主页https://libgit2.org/
仓库https://github.com/libgit2/libgit2
上游文档https://libgit2.org/docs
许可证GPL-2.0-only WITH GCC-exception-2.0
源码归档https://github.com/libgit2/libgit2/archive/refs/tags/v1.9.4.tar.gz
最后更新2026-05-22T13:50:55Z
Pulseupdated
依赖libssh2, llhttp
构建依赖cmake, pkgconf
Bottle可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux)
Homebrew post-install未定义
服务未声明

注册表事实

源数据库详情

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Namelibgit2
Aliases
  • libgit2@1.9
Version Scheme0
Revision0
Head VersionHEAD
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • head
  • stable

源数据库匹配

其他软件包管理器记录

匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。

Debian apt95%

libgit2-1.9 1.9.0+ds-2

low-level Git library

https://libgit2.github.com/

sudo apt install libgit2-1.9
  • Section: libs
  • Architecture: amd64
  • Source Package: libgit2
  • 9 依赖
  • normalized package name match
  • 匹配方式:Libgit2
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libgit2-1.9 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

libgit2-dev 1.9.0+ds-2

low-level Git library (development files)

https://libgit2.github.com/

sudo apt install libgit2-dev
  • Section: libdevel
  • Architecture: amd64
  • Source Package: libgit2
  • 6 依赖
  • normalized package name match
  • 匹配方式:Libgit2
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libgit2-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

libgit2-fixtures 1.9.0+ds-2

low-level Git library - test suite examples

https://libgit2.github.com/

sudo apt install libgit2-fixtures
  • Section: libs
  • Architecture: all
  • Source Package: libgit2
  • normalized package name match
  • 匹配方式:Libgit2
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libgit2-fixtures from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

libgit2

nix profile install nixpkgs#libgit2
  • normalized package name match
  • 匹配方式:Libgit2
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/li/libgit2/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt95%

libgit2-1.7 1.7.2+ds-1ubuntu3

low-level Git library

https://libgit2.github.com/

sudo apt install libgit2-1.7
  • Section: libs
  • Architecture: amd64
  • Source Package: libgit2
  • 7 依赖
  • normalized package name match
  • 匹配方式:Libgit2
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libgit2-1.7 from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

libgit2-dev 1.7.2+ds-1ubuntu3

low-level Git library (development files)

https://libgit2.github.com/

sudo apt install libgit2-dev
  • Section: libdevel
  • Architecture: amd64
  • Source Package: libgit2
  • 6 依赖
  • normalized package name match
  • 匹配方式:Libgit2
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libgit2-dev from https://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/Packages.gz
Ubuntu apt95%

libgit2-fixtures 1.7.2+ds-1ubuntu3

low-level Git library - test suite examples

https://libgit2.github.com/

sudo apt install libgit2-fixtures
  • Section: universe/libs
  • Architecture: all
  • Source Package: libgit2
  • normalized package name match
  • 匹配方式:Libgit2
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libgit2-fixtures from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

libgit2 1.9.4-r1

linkable library for Git

https://libgit2.org/

sudo apk add libgit2
  • License: GPL-2.0-only WITH GCC-exception-2.0
  • Architecture: x86_64
  • Source Package: libgit2
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Libgit2
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libgit2 from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libgit2-dbg 1.9.4-r1

linkable library for Git (debug symbols)

https://libgit2.org/

sudo apk add libgit2-dbg
  • License: GPL-2.0-only WITH GCC-exception-2.0
  • Architecture: x86_64
  • Source Package: libgit2
  • 1 依赖
  • normalized package name match
  • 匹配方式:Libgit2
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libgit2-dbg from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libgit2-dev 1.9.4-r1

linkable library for Git (development files)

https://libgit2.org/

sudo apk add libgit2-dev
  • License: GPL-2.0-only WITH GCC-exception-2.0
  • Architecture: x86_64
  • Source Package: libgit2
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Libgit2
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libgit2-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libgit2-static 1.9.4-r1

linkable library for Git (static library)

https://libgit2.org/

sudo apk add libgit2-static
  • License: GPL-2.0-only WITH GCC-exception-2.0
  • Architecture: x86_64
  • Source Package: libgit2
  • 1 依赖
  • normalized package name match
  • 匹配方式:Libgit2
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libgit2-static from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libgit2-tests 1.9.4-r1

linkable library for Git (tests)

https://libgit2.org/

sudo apk add libgit2-tests
  • License: GPL-2.0-only WITH GCC-exception-2.0
  • Architecture: x86_64
  • Source Package: libgit2
  • normalized package name match
  • 匹配方式:Libgit2
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libgit2-tests from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
apk95%

libgit2-tools 1.9.4-r1

linkable library for Git (tools)

https://libgit2.org/

sudo apk add libgit2-tools
  • License: GPL-2.0-only WITH GCC-exception-2.0
  • Architecture: x86_64
  • Source Package: libgit2
  • 1 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Libgit2
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: libgit2-tools from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
dnf95%

libgit2 1.9.4-1.fc45

C implementation of the Git core methods as a library with a solid API

https://libgit2.org/

sudo dnf install libgit2
  • License: GPL-2.0-only WITH GCC-exception-2.0 AND MIT AND LicenseRef-Fedora-Public-Domain AND Apache-2.0 AND SSLeay-standalone AND BSD-2-Clause AND NCSA AND Unlicense
  • Category: Unspecified
  • Architecture: i686
  • Source Package: libgit2
  • 8 依赖
  • 3 提供
  • normalized package name match
  • 匹配方式:Libgit2
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: libgit2 from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

libgit2-devel 1.9.4-1.fc45

Development files for libgit2

https://libgit2.org/

sudo dnf install libgit2-devel
  • License: GPL-2.0-only WITH GCC-exception-2.0 AND MIT AND LicenseRef-Fedora-Public-Domain AND Apache-2.0 AND SSLeay-standalone AND BSD-2-Clause AND NCSA AND Unlicense
  • Category: Unspecified
  • Architecture: i686
  • Source Package: libgit2
  • 5 依赖
  • 3 提供
  • normalized package name match
  • 匹配方式:Libgit2
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: libgit2-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
pacman95%

libgit2 1:1.9.4-1

A linkable library for Git

https://github.com/libgit2/libgit2

sudo pacman -S libgit2
  • License: LicenseRef-GPL-2.0-only-with-linking-exception
  • Architecture: x86_64
  • 11 依赖
  • 1 提供
  • normalized package name match
  • 匹配方式:Libgit2
Arch Linux sync databases · geo.mirror.pkgbuild.com · Arch Linux sync databases: libgit2 from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

来源线索

由仓库数据生成

此页面由 av-webscripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。

使用的来源

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment