This repository implements the following git commands from scratch in rust:
- init
- commit
- cat-file
- hash-object
- ls-tree
- write-tree
- commit-tree
including only the core functionality (no fancy flags).
git:
git init
git-in-rust:
cargo run -- init
only -m flag
git:
git commit -m "Committing hard"
git-in-rust:
cargo run -- cat-file -p e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
only -p flag
git:
git cat-file -p e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
git-in-rust:
cargo run -- cat-file -p e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
only -w flag
git:
git hash-object -w test.txt
git-in-rust:
cargo run -- hash-object -w test.txt
only --name-only flag
git:
git ls-tree --name-only 825dc642cb6eb9a060e54bf8d69288fbee4904
git-in-rust:
cargo run -- ls-tree --name-only 825dc642cb6eb9a060e54bf8d69288fbee4904
git:
git write-tree
git-in-rust:
cargo run -- write-tree
only -m and -p flags
git:
git commit-tree 825dc642cb6eb9a060e54bf8d69288fbee4904 -p f6ef0ed87e78ca3c0262fbb887053940d1a0275d -m "Committing hard"
git-in-rust:
cargo run -- commit-tree 825dc642cb6eb9a060e54bf8d69288fbee4904 -p f6ef0ed87e78ca3c0262fbb887053940d1a0275d -m "Committing hard"