A Git-inspired version control system written in C++ for Linux.
dd was built from scratch to understand how modern version control systems work internally. Instead of relying on existing libraries, the project implements core concepts such as content-addressable storage, immutable objects, commit history, branching, checkout, and repository reconstruction.
- Initialize and manage repositories.
- Store data using content-addressable object storage.
- Support blob, tree, and commit objects.
- Stage and track file changes through an index.
- Create commits and traverse repository history.
- Create, list, and switch between branches.
- Checkout commits or branches and reconstruct the working tree.
- Architecture — Overview of the repository design, object model, and component relationships.
- Storage Format — Details of blob, tree, commit, and index storage formats.
- Linux
- CMake
- C++17 compatible compiler
git clone <repository>
cd dd
mkdir build
cd build
cmake ..
cmake --build .dd initdd add file.txtdd commit -m "initial commit"dd logdd branch devdd branchdd checkout devdd checkout <commit_hash>.dd/
├── objects/
│
├── refs/
│ └── heads/
│
├── HEAD
├── index
└── config
| Component | Purpose |
|---|---|
| objects/ | Stores all immutable objects |
| refs/heads/ | Branch references |
| HEAD | Current checked-out branch or commit |
| index | Staging area |
| config | Repository configuration |
During development, the project explored:
- Content-addressable storage
- Hash-based object databases
- Snapshot-based version control
- Commit graph traversal
- Recursive tree structures
- Filesystem manipulation
- Layered software architecture
- CLI application design
- Persistent storage systems
Potential future extensions include:
- Diff engine
- Three-way merge
- Merge commits
- Tags
- Object compression
- Packfiles
- Remote repositories
- Push / Pull support
- Clone support
- Conflict resolution
- Detached HEAD improvements
This project was inspired by the design principles of Git and was developed as an educational exploration of version control internals and systems programming in C++.