Geet is a lightweight Git implementation built with Rust. This README provides a step-by-step guide to building, running, and using Geet commands.
-
Build the
geet
binary using Cargo:cargo build
-
Add the
geet
binary to your system's PATH:export PATH=$PATH:$(pwd)/target/debug
Create a test repository and initialize it with Geet:
mkdir test
cd test
geet init
Add (stage) a file to the repository:
geet add test.txt
Commit staged changes with a message:
geet commit -m "first one"
Check the current status of the repository (what is staged and not staged)
geet status
View the content of a file or commit details:
geet cat test.txt
geet cat <commit-hash>
Switch to a previous commit using its hash:
geet checkout a145d0486463ceb2840f5c871608f142b713736f
Reset the repository for a fresh start:
geet cleanup
- After the initial setup, all commands can be run directly with
geet
instead ofcargo run --
. - Replace
<commit-hash>
in commands with the actual hash of the commit you want to reference. - The cat command supports both current files and commit objects with formatted output.
- The cleanup command safely removes the .geet directory, allowing for a fresh repository initialization.
Feel free to update this README as you add more features to Geet!
- right now we can make identical commits multiple times. Check if the tree_hash is the same, if it is don't create a new commit
- right now we can re-init a repository, disable that
- refactor cli parser error handling using ?
- refactor command handling code to be a group of helper functions, no more enums
- when we make a new commit, we only change HEAD to point to it. We need to make the current branch to point to it as well
- ~~add/remove treats path with "./" prefix as unique from the same path without it ~~ (solved)
- status command treats empty files the same, because empty content gets hashed to the same value
- cat command does not support a specific file of a specific commit
- hide the initial system commit from log??
- geet log printing commits in seemingly random order