CS01 is a lightweight, educational version control system (VCS) originally implemented in TypeScript and now rewritten in Rust, inspired by Git. It mimics core Git behaviors like repository initialization, file staging, committing, and branching, but with a focus on simplicity, type safety, and modularity.
This project serves as a learning resource for understanding VCS internals. The original TypeScript codebase is preserved in the reference_ts/ directory for educational comparison.
Current Phase: Functionality Migration
- Repository Initialization (
init) - Fully implemented and compatible with TS version. - File Staging (
add) - Upcoming. - Committing (
commit) - Upcoming.
- Rust: Ensure you have a recent version of Rust installed (via
rustup).
git clone https://github.com/Computer-Scientist-01/CS-01
cd CS-01
cargo build --releaseInitialize a new CS01 repository in the current directory:
cargo run -- initThis creates a template .CS01 directory with the default configuration.
To initialize a bare repository:
cargo run -- init --bareTo specify a custom initial branch name:
cargo run -- init --initial-branch=masterRun the improved integration test suite:
# Note: Single-threaded execution is required for tests that modify CWD
cargo test -- --test-threads=1To explore or run the original TypeScript implementation:
cd reference_ts
bun install
bun test- Check the
reference_tsfolder to understand the expected behavior. - Implement the equivalent logic in Rust.
- Write matching integration tests.