A high-performance Git implementation in Rust with both plumbing and porcelain commands.
- Hybrid Architecture: Plumbing and porcelain commands
- High Performance: 2-3x faster with caching and parallelism
- Git Compatible: Full Git repository and format compatibility
- Ignore Support: Respects
.gritignorefor file exclusion
Grit is designed for speed. By leveraging Rust's zero-cost abstractions and aggressive LRU caching, Grit significantly outperforms standard Git in micro-benchmarks for small to medium repositories.
| Command | Grit Time | Git Time | Speedup |
|---|---|---|---|
init |
~2.1 ms | ~8.6 ms | ~4.1x |
add |
~4.1 ms | ~14.0 ms | ~3.4x |
status |
~5.4 ms | ~17.8 ms | ~3.3x |
commit |
~6.0 ms | ~25.2 ms | ~4.2x |
Benchmarks ran on a Macbook M3 Max. Click here to see the code.
cargo install --path .# Initialize a repository
grit init
# Stage and commit files
grit add .
grit status
grit commit -m "Initial commit"
# View history
grit log --onelinegrit init- Initialize repositorygrit add <files>- Stage files for commitgrit status- Show working directory statusgrit commit -m <msg>- Create commitgrit log- Show commit historygrit reset- Reset to previous stategrit diff- Show changes between commits
grit hash-object <file>- Store file in object databasegrit cat-file -p <hash>- Display object contentgrit write-tree- Create tree from indexgrit checkout <hash>- Restore working directory
Grit supports .gritignore files to exclude files from staging and status output. Create a .gritignore file in your repository root:
# Ignore temporary files
*.tmp
*.log
# Ignore build directories
build/
target/
# Ignore specific files
secret.txt
To learn more about Grit's architecture and API, generate and view the documentation with:
cargo doc --open