A lightweight Git implementation in C++ that provides core version control functionality.
- init - Initialize a new repository
- register - Register user credentials (username and email)
- hash-object - Compute object ID and optionally create a blob from a file
- cat-file - Display contents of repository objects
- ls-tree - List the contents of a tree object
- write-tree - Create a tree object from the current index
- commit-tree - Create a new commit object
- C++17 compatible compiler (g++, clang++)
- OpenSSL library (for SHA1 hashing)
- zlib library (for compression)
Ubuntu/Debian:
sudo apt-get install build-essential libssl-dev zlib1g-devFedora/RHEL:
sudo dnf install gcc-c++ openssl-devel zlib-develmacOS:
brew install openssl zlib# Build the project
make
# Build with debug symbols
make debug
# Build with optimizations
make release
# Clean build artifacts
make clean
# Rebuild from scratch
make rebuildThe compiled binary will be located at bin/verz.
./bin/verz initCreates a .verz directory with the basic repository structure:
.verz/objects/- Object database.verz/refs/- References.verz/HEAD- Current branch reference
verz/
├── bin/ # Build output directory
│ └── obj/ # Object files
├── include/ # Header files
│ ├── cat_file.h
│ ├── commit_tree.h
│ ├── hash_object.h
│ ├── init.h
│ ├── ls_tree.h
│ ├── register.h
│ ├── utils.h
│ └── write_tree.h
├── src/ # Source files
│ ├── main.cpp
│ └── cmd/ # Command implementations
│ ├── cat_file.cpp
│ ├── commit_tree.cpp
│ ├── hash_object.cpp
│ ├── init.cpp
│ ├── ls_tree.cpp
│ ├── register.cpp
│ └── write_tree.cpp
├── Makefile # Build configuration
└── README.md
To install verz system-wide (requires sudo):
make installThis installs the binary to /usr/local/bin/verz.
To uninstall:
make uninstallThis project is for educational purposes.