NAME
Nit — A Minimal Git in Rust — A minimal Git reimplementation written in Rust, building the core object model, binary index, and a subset of plumbing and porcelain commands from scratch — no libgit2, no git binary underneath.
SYNOPSIS
DESCRIPTION
Repository: GitHub - m-elhabib-dev/nit
Nit is a learning-oriented Git reimplementation written in Rust. It implements the core Git object model, index, and a subset of the plumbing and porcelain commands from scratch — no libgit2, no git binary underneath.
Repos created by Nit use the same on-disk format as Git, so they can be inspected with plain git (e.g. git log, git fsck) and vice versa, as long as you stick to the commands Nit supports.
Implemented commands:
nit init— create a.gitrepository skeletonnit hash-object [-w] <file>— compute an object hash, optionally write itnit cat-file -p <hash>— pretty-print an objectnit write-tree— write the working tree as a tree objectnit ls-tree [--name-only] <tree-hash>— list the entries of a treenit commit-tree -m <msg> [-p <parent>] <tree-hash>— write a commit objectnit commit -m <msg>— write tree + commit, update the current branchnit add <file>— stage a file (or.for everything) into the indexnit status— show modified, deleted, and untracked filesnit clone <path>— clone a local repository
TECH STACK
ARCHITECTURE
Blobs, trees, and commits stored in .git/objects with SHA-1 naming and zlib compression via flate2. Binary index file compatible with Git format (header, entries, trailing SHA-1 checksum). On-disk format identical to real Git repositories. Partial HTTP smart-protocol implementation (git-upload-pack, pkt-line framing) for remote cloning.
BUGS / CHALLENGES
Packfiles containing OFS_DELTA and REF_DELTA objects are not fully supported — the remote-cloning experiment reached the PACK format and parses normal objects, but delta objects still need implementation. .gitignore is not implemented. Remote cloning over HTTP is incomplete. Windows path handling and non-UTF-8 filenames are not covered.
EXIT STATUS / OUTCOMES
Implemented the core Git object model and a Git-compatible binary index from scratch in Rust. Delivered working plumbing and porcelain commands including commit, status, add, and local clone. Produced repositories fully inspectable with real Git tooling.