vcs is a small, local version control system I built to practice modern C++.
Disclaimer This is a learning project. It is not intended for production use and may not be actively maintained.
Features:
- Local repository initialization
- Stage files for commit
- Create commits with complete file snapshots
- View commit history
- Switch to previous commits
Intentional limitations:
- No network functionality
- No diff algorithms
- No branches or merging
- No compression or delta storage
- Non-cryptographic hashing (deterministic FNV-1a; local use only)
- Custom Base64 implementation (minimal; not designed for adversarial input)
vcs/
├── CMakeLists.txt # Build configuration
├── README.md # This document
├── include/vcs/ # Public header files
│ ├── cli/ # Command-line interface
│ ├── core/ # Core domain logic
│ ├── storage/ # Storage and filesystem
│ └── utils/ # Utility functions
├── src/ # Implementation files
│ ├── cli/ # CLI implementation
│ ├── core/ # Core implementation
│ ├── storage/ # Storage implementation
│ ├── utils/ # Utils implementation
│ └── main.cpp # Program entry point
└── tests/ # Unit tests
- CLI: Parses arguments and calls into the core layer
- Core: Repository operations and data types (Repository, Commit, Index)
- Storage: Filesystem and on-disk layout (.vcs, objects)
- Utils: Logging, errors, hashing
- CMake 3.20 or higher
- C++20 compatible compiler (GCC 11+, Clang 14+, or MSVC 2019+)
- Git (for cloning the repository)
# Configure and build
cmake -S . -B build
cmake --build build
# Run executable
./build/vcs helpThe following commands assume that the vcs executable is available in the build directory or in PATH.
# Initialize repository
vcs init
# Add files or directories to staging area (recursive)
vcs add file.txt
vcs add src/
vcs add .
# Create commit
vcs commit "First version"
# Show history
vcs log
# Switch to a commit, tracked files are synced; tracked files missing in target are removed; untracked stay
vcs checkout <commit-hash>Unit tests use Catch2 and run via CTest.
# Run tests
ctest --test-dir buildThe generated Doxygen docs are published via GitHub Pages:
This is a learning project. Feedback is welcome, but the project may not be actively maintained.
This project is licensed under the MIT License - see the LICENSE file for details.