Pure managed C# implementation for reading from Git repositories.
- Portable and simple
- No dependencies on native code.
- No dependencies on file system.
- Cloning via Git Smart HTTP
- Efficient partial cloning of subdirectories.
- Configurable API for caching git objects to make cloning more efficient.
NuGet: https://www.nuget.org/packages/GitCore/
dotnet add package GitCore
var subdirectoryContents =
await GitCore.LoadFromUrl.LoadSubdirectoryContentsFromGitUrlAsync(
gitUrl: "https://github.com/pine-vm/pine.git",
commitSha: "c837c8199f38aab839c40019a50055e16d100c74",
subdirectoryPath: ["guide"]);In the past, I had used LibGit2Sharp to clone Git repositories and read their files. That often works, but the native dependencies of such a solution have caused many problems.
For any app that's hosted in .NET anyway, a pure managed implementation seems the natural way to simplify builds and operations.