grit
CLILibrary
HEAD → docs/library
Library guideMarkdown

Library guide

Use grit-lib from Rust — the same engine that powers the grit CLI.

These pages walk through opening a repository, the object database, refs, the index, diffs, history walks, and network transport using grit-lib. Each guide includes a compiled example from grit-examples that tests against the system git binary.

Page Topic
Repository Discover, open, config, errors
Embedding Environment, sinks, subprocess injection, concurrency
Objects Odb read/write, object kinds
Refs Resolve, list, update refs and reflog
Index Read index, stage paths, write trees
Diff Tree, index, and blob diffs
Revwalk Rev-parse, rev-list, ranges, merge base
Network ls-remote, fetch, push, credentials
API map Generated module and type index with docs.rs links

For exhaustive API detail see grit-lib on docs.rs.