grit
HEAD → mainc0ffee1

Grit

A new Git client and library, in Rust.

Compatible with every repository and every remote. Simpler to use, quick to run, and MIT-licensed throughout.

$ curl -fsSL grit-scm.com/install | shcargo add grit-lib
c0deba5e · feat(compat)

Every repo you already have.

Same .git directory, same pack format, same remotes. GitHub, GitLab, your CI and your teammates won't notice. Switch to Grit mid-branch and switch back whenever you like.

deadbeef · refactor(cli)

Simpler on purpose.

The commands you know, with clearer output and fewer footguns. The CLI is a thin layer over the library, so whatever the CLI can do, your code can do.

$ grit clone https://github.com/BurntSushi/ripgrep.git
Cloning https://github.com/BurntSushi/ripgrep.git → ripgrep
✓ Receiving  ▃▃▃▃▆▆▆███▆▆▆▆▆▆▆▆▆▆▆▆▇▇▇▅▅▅          5.67 MiB         13.0 MiB/s   435ms
✓ Indexing   ▆▆▆▆▆▆▆▆▆▆▆▆▆▆██████████████    14,062 objects   343.1k objects/s    40ms
✓ Resolving  ████████████████████████████      9,840 deltas    370.3k deltas/s    26ms
✓ Checkout   ████████████████████████████         237 files       4.6k files/s    51ms

✓ Cloned into ripgrep on master in 1.6s
ca11ab1e · feat(lib) · branch: grit-lib

Link it. Don't shell out.

Objects, packs, index, refs, diff, merge as typed Rust modules. No process spawn, no parsing porcelain output.

use grit_lib::{diff, repo::Repository};

let repo = Repository::discover(None)?;
let index = repo.load_index()?;
if let Some(wt) = &repo.work_tree {
  for f in diff::diff_index_to_worktree(&repo.odb, &index, wt, false, false)? {
    println!("{:?} {}", f.status, f.path());
  }
}
feedface · docs(agents)

Docs your agent can read.

Each half of the docs is one Markdown file: grit-cli.md teaches an agent the CLI for everyday Git work, and grit-lib.md covers building Git-compatible Rust programs. llms.txt indexes every page.