CodeBrix.LibGit2.MitLicenseForever
1.0.292.267
dotnet add package CodeBrix.LibGit2.MitLicenseForever --version 1.0.292.267
NuGet\Install-Package CodeBrix.LibGit2.MitLicenseForever -Version 1.0.292.267
<PackageReference Include="CodeBrix.LibGit2.MitLicenseForever" Version="1.0.292.267" />
<PackageVersion Include="CodeBrix.LibGit2.MitLicenseForever" Version="1.0.292.267" />
<PackageReference Include="CodeBrix.LibGit2.MitLicenseForever" />
paket add CodeBrix.LibGit2.MitLicenseForever --version 1.0.292.267
#r "nuget: CodeBrix.LibGit2.MitLicenseForever, 1.0.292.267"
#:package CodeBrix.LibGit2.MitLicenseForever@1.0.292.267
#addin nuget:?package=CodeBrix.LibGit2.MitLicenseForever&version=1.0.292.267
#tool nuget:?package=CodeBrix.LibGit2.MitLicenseForever&version=1.0.292.267
CodeBrix.LibGit2
A Git repository library for .NET, built on the libgit2 native Git implementation.
CodeBrix.LibGit2 is provided as a .NET 10 library and associated CodeBrix.LibGit2.MitLicenseForever NuGet package.
CodeBrix.LibGit2 supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.
Installation
dotnet add package CodeBrix.LibGit2.MitLicenseForever
Note that the NuGet package ID and the namespace are different - there is no package named plain CodeBrix.LibGit2:
- NuGet package ID:
CodeBrix.LibGit2.MitLicenseForever - Assembly and primary namespace:
CodeBrix.LibGit2- i.e.using CodeBrix.LibGit2;
XML documentation (IntelliSense) ships alongside the assembly.
CodeBrix.LibGit2 has no dependencies other than .NET. The native Git library for each supported platform is inside the package, so no Git installation is needed on the target machine.
CodeBrix.LibGit2 supports:
- Creating, opening, discovering and cloning repositories, including bare repositories, shallow clones and linked worktrees
- Walking and filtering commit history, and per-file history
- Staging, unstaging, removing and moving files, and committing (including amend)
- Working-directory status, with ignore rules and
.gitattributes - Branches, tags (lightweight and annotated), references, reflogs and notes
- Checkout, reset (soft, mixed, hard), clean, stash, cherry-pick and revert
- Merge (fast-forward or merge commit, with conflict reporting) and rebase
- Diffs between trees, the index and the working directory, as change lists, patches and line statistics
- Blame and describe
- Remotes: fetch, pull, push and listing remote references over HTTPS, SSH and local paths, with credential, certificate-check and progress callbacks
- Submodules and worktrees
- Repository, global and system configuration
- Direct object-database access: blobs, trees, commits, tag annotations, pack building, archives and custom backends
- Content filters, custom transports and native trace logging
- Native libraries for nine runtime identifiers, selected automatically by NuGet
Native libraries
The native Git library is packed under runtimes/<rid>/native/ for each of these runtime identifiers, next to a copy of its licence:
win-x64, win-arm64, osx-x64, osx-arm64, linux-x64, linux-arm64, linux-riscv64, android-arm64, android-x64
Building or publishing an application for one of those runtime identifiers picks up the matching binary; no extra package is needed. How network transports work on each platform:
- Windows - HTTPS uses the operating system's own TLS stack (Schannel).
ssh://URLs are handled by running thesshprogram found on the machine. - macOS - HTTPS uses the operating system's own TLS stack (SecureTransport).
ssh://URLs are handled by running the systemsshprogram. The macOS libraries require macOS Sonoma or later. - Linux - HTTPS uses the OpenSSL libraries already installed on the machine (
libsslandlibcrypto), which are loaded the first time HTTPS is used; without them, HTTPS operations fail while everything else keeps working.ssh://URLs are handled by running the systemsshprogram. The binaries are built for a low glibc baseline, so the same file runs on current and older distributions. - Android - HTTPS support is built into the library itself; nothing extra is needed on the device. There is no SSH transport on Android.
Local repositories and file:// URLs need no network support at all.
To load the native library from a folder of your own instead, set GlobalSettings.NativeLibraryPath to that folder, holding the binary under its shipped name, before making any other call into the library.
Sample Code
Open a Repository and Walk Its History
using System;
using System.Linq;
using CodeBrix.LibGit2;
using (var repo = new Repository("/path/to/repo"))
{
Console.WriteLine($"On branch {repo.Head.FriendlyName}");
foreach (Commit commit in repo.Commits.Take(10))
{
Console.WriteLine($"{commit.Id.ToString(7)} {commit.Author.Name} {commit.MessageShort}");
}
}
Clone a Repository
using System;
using CodeBrix.LibGit2;
string gitDir = Repository.Clone("https://github.com/ellisnet/CodeBrix.LibGit2.git", "/path/to/clone");
using (var repo = new Repository(gitDir))
{
Console.WriteLine($"Cloned {repo.Head.FriendlyName} at {repo.Head.Tip.Sha}");
}
CloneOptions adds a branch name, a bare clone, progress reporting and a credentials callback for private repositories.
Create a Repository, Stage a File and Commit It
using System;
using System.IO;
using CodeBrix.LibGit2;
string repoPath = Repository.Init("/path/to/my-new-repo");
using (var repo = new Repository(repoPath))
{
File.WriteAllText(Path.Combine(repo.Info.WorkingDirectory, "hello.txt"), "Hello, Git!\n");
Commands.Stage(repo, "hello.txt");
var author = new Signature("A. U. Thor", "thor@example.com", DateTimeOffset.Now);
Commit commit = repo.Commit("Add hello.txt", author, author);
Console.WriteLine($"Committed {commit.Sha} on {repo.Head.FriendlyName}");
}
Always dispose a Repository (as above with using) - it holds native resources and open file handles.
Documentation
The NuGet package includes AGENT-README.txt, a complete API reference and usage guide written for AI coding agents - point your agent at that file when it is writing code against this library.
Additional sample code and usage examples are available in the CodeBrix.LibGit2.Tests project:
https://github.com/ellisnet/CodeBrix.LibGit2/tree/main/tests/CodeBrix.LibGit2.Tests
License
CodeBrix.LibGit2 is licensed under the MIT License - see the LICENSE file.
For licensing and provenance information about the open source code included in this package, see THIRD-PARTY-NOTICES.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CodeBrix.LibGit2.MitLicenseForever:
| Package | Downloads |
|---|---|
|
CodeBrix.RustTools.CrateBuilder.MitLicenseForever
A .NET library that turns a Rust crate into native binaries and a .NET 10 wrapper class library. It clones the crate from a Git repository with CodeBrix.LibGit2 (or takes a local Cargo.toml), checks first that the machine can build and returns install guidance when it cannot, builds the crate for the chosen runtime identifiers with the installed Rust toolchain or inside a Docker container, optionally links it to the CodeBrix WebGPU engine, generates a C facade for plain Rust libraries from their public API, and writes a .NET 10 wrapper class library (optionally packable as a NuGet package) around the result, together with a JSON build record. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.292.267 | 95 | 10/19/2026 |
| 1.0.290.970 | 93 | 10/17/2026 |