A lightweight implementation of Git in Rust, built from scratch. This project aims to replicate Git's core functionality from the ground up, focusing on correctness and clarity rather than full feature parity.
Build and run the CLI:
cargo build --release
./target/release/rust-git-lite <command>rust-git-lite init# Hash and write a file as a blob object
rust-git-lite hash-object -w hello.txt
# Just compute the hash without writing
rust-git-lite hash-object hello.txt# Pretty-print the contents of an object
rust-git-lite cat-file -p <object-hash># Show full tree details
rust-git-lite ls-tree <tree-hash>
# Show only filenames
rust-git-lite ls-tree --name-only <tree-hash># Create a tree from the current working directory
rust-git-lite write-treeUnlike the actual git write-tree command, which creates a tree object from the current state of the staging area (where changes go when you run git add), this minimal implementation does not implement a staging area.
Instead, write-tree assumes that all files in the working directory are staged. This means it will create a tree object from the entire working directory, excluding the .git folder.