Grit: Rewriting Git in Rust with agents
AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Grit is a project that rewrites Git from scratch in Rust, utilizing a swarm of agents to develop a memory-safe, library-based version that passes most of the Git test suite. It aims to improve safety, modularity, and usability in various contexts.

A developer has introduced Grit, a new Rust-based implementation of Git that passes over 99% of the official Git test suite, marking a major milestone in reimagining Git as a safe, modular library using agent-based development.

Before you orderOffer from Amazon

Get the latest gadgets delivered free with Prime

  • Fast, free delivery on millions of items
  • Prime Video, Amazon Music and more included
  • Member-only deals all year
Start your free Prime trial Free trial for eligible customers · Cancel anytime
As an affiliate, we earn on qualifying purchases.

The project, initiated over several months, aims to create a comprehensive, reentrant, linkable Git core library in Rust. Unlike traditional Git, which is built on a chain of Unix commands, Grit is designed as a memory-safe, library-centric system that can be embedded into various applications and environments.

Grit currently passes most relevant tests but not all, with some skipped due to complexity or irrelevance to core functionality. The developer emphasizes that the project is still experimental, with no production use yet, and warns of potential bugs or data corruption if used improperly. The goal is to develop a tool that surpasses the limitations of existing implementations like libgit2 and Gitoxide, especially in network operations and WASM environments.

Implications for Git Development and Embedding

Grit’s development demonstrates that a safe, modular, Rust-based Git core is feasible, potentially transforming how Git is integrated into applications, cloud services, and embedded systems. Its agent-driven approach offers a new pathway for continuous, automated development, reducing bugs and increasing safety. If further refined, Grit could enable faster, more reliable Git operations in environments where performance and safety are critical, such as web assembly, cloud functions, and custom Git server implementations.

Products Worth Considering

Apple MacBook Air 15-inch Laptop with M5 Chip, 16GB Memory, 512GB SSD, Liquid Retina Display, and Touch ID (Midnight)

Apple MacBook Air 15-inch Laptop with M5 Chip, 16GB Memory, 512GB SSD, Liquid Retina Display, and Touch ID (Midnight)

Kindle Paperwhite Signature Edition 32GB (2024 Model) - Metallic Black

Kindle Paperwhite Signature Edition 32GB (2024 Model) – Metallic Black

As an affiliate, we earn on qualifying purchases.

Background on Git Rewriting Efforts and Rust Adoption

Git, created over 20 years ago, is a complex system built on a chain of Unix commands, making it difficult to embed or extend efficiently. Existing reimplementations like libgit2 and Gitoxide have limitations in speed, safety, and completeness, especially for network operations. The idea of rewriting Git in a safer language like Rust has been discussed for years, but practical attempts have been limited. Inspired by recent experiments with agent-based code generation, the developer embarked on creating Grit, aiming to produce a safer, more modular version that can be integrated into modern workflows and environments.

“Grit is not just a port; it’s a new foundation for Git in Rust, designed to be safe, modular, and embeddable, passing most of the core tests.”

— the developer behind Grit

“Reimplementing Git in Rust could significantly improve safety and performance, especially for embedded and web-based applications.”

— a Rust community contributor

Remaining Challenges and Limitations of Grit

Grit is still in early development; it does not pass all tests, and some features like email handling, internationalization, and importers are skipped. Performance issues, API design, and cross-platform support (notably Windows) remain unresolved. Its stability and safety in real-world use are unconfirmed, and it may contain bugs or data corruption risks if deployed prematurely.

Upcoming Development Milestones for Grit

The developer plans to refine the codebase, improve performance, complete testing for skipped areas, and develop comprehensive documentation. Future steps include building a stable release, exploring WASM support for browser and edge environments, and integrating Grit into existing tools like GitButler and Jujutsu. Community feedback and contributions are encouraged to accelerate progress toward a production-ready version.

Key Questions

What is Grit and how does it differ from traditional Git?

Grit is a reimplementation of Git written entirely in Rust, designed as a safe, modular library that can be embedded into applications. Unlike traditional Git, which is built on Unix command chaining, Grit aims for a reentrant, linkable core with agent-based development to improve safety and extensibility.

Can Grit replace Git in production environments now?

No. Grit is still experimental, passes most core tests but not all, and may contain bugs. It is not recommended for production use until further development and testing are completed.

What are the main advantages of rewriting Git in Rust?

Rust provides memory safety, concurrency, and modularity, which can reduce bugs, improve performance, and facilitate embedding Git functionality into various environments, including web assembly and custom applications.

Will Grit support Windows or other platforms soon?

Support for Windows and other platforms is not yet available. The current focus is on stabilizing core functionality and performance improvements before expanding platform compatibility.

How can I contribute or follow Grit’s development?

The developer encourages community feedback, bug reports, and contributions. Updates are likely to be shared through the project’s website and repositories, with plans for more documentation and milestones in the coming months.

Source: Hacker News

You May Also Like

Backrest – a web UI and orchestrator for restic backup

Backrest is a new web-based UI and orchestrator for restic, offering easy backup management, scheduling, and remote access across multiple platforms.

A Frontier AI Model Just Went Dark for 18 Days. The Kill-Switch Is Real Now.

A leading AI model was globally disabled for 18 days due to government orders, marking a new era of AI control and raising questions about future releases.

The newest AI boom pitch: Host a mini data center at your home

SPAN plans to install mini data centers in new homes, offering subsidized power and internet, aiming to expand AI compute capacity and reduce infrastructure costs.

7 Best PC Motherboards for Prime Day Deals in 2026

Discover the best PC motherboard deals for Prime Day 2026, including options for AM4 and AM5 platforms, plus niche boards for compact projects.