This has not been fully tested on Windows yet, so if you are using Windows and have found some issues, please Raise an issue. :)
I am using the filesystem library to make it cross-platform. Use Visual Studio, I've provided the .sln file or generate it from the CMAKE provided in VS.
- This is a project to make my own version control with some improvements.
- Through this, I wanted to learn the backend of version control and make my grasp stronger on C++.
- I will be learning a lot about file system, hashing and generating diffs between files.
- and use case of Graphs and Linked lists for history traversal.
- Clone/Download this repository.
- Open the terminal and navigate to this directory.
- Run the following command:
mkdir build
cd build
cmake ..
make - The
cmake ..will make the a "makefile" and then you can "make" it usingmakecommand. - Go to
build/binand you will find the executable. - Run the executable file and initialize an empty yeet repo:
./yeet init [path](Or better, don;t go to build/bin and
./build/bin/yeet init . | Command | Description | Example |
|---|---|---|
yeet init . |
Initialize repository | ./yeet init . |
yeet status |
Show changes | ./yeet status |
yeet commit |
Create commit | ./yeet commit |
yeet history |
View commit log | ./yeet history |
yeet branch |
Manage branches | ./yeet branch |
yeet checkout <branch> |
Switch branch | ./yeet checkout feature |
yeet checkoutchanges branch pointer but doesn't update working directory files yet- All files are automatically staged - no manual
addsupport yet - Cannot choose base branch when creating new branches (uses current branch)
- Executable files are tracked but diffs are not displayed in status
YEET/
├── YEET.sln # Main solution file
├── YeetCore/ # Core functionality as static library
├── YeetUtils/ # Utility functions as static library
├── YeetCLI/ # Command-line interface executable
└── YeetTests/ # Test project
For now, I have added cryptopp into the repositry itself, but later I will be removing it. So you might need to download it. (For now, no need to do the following steps)
you have lcryptopp installed in your system. I am using fedora and I installed it using:
sudo dnf install cryptopp-develSearch according to your OS.
The below are very minimal and abstracted view of the working of the project. You have to go throught the code to learn the details of the implementation.
Use the Testing_inflating.cpp file as follow for decompressing your blob data:
g++ -lz Testing_Inflating.cpp -o Testing_inflate && ./Testing_inflateYou can also use the following command:
zlib-flate -uncompress < .yeet/objects/5d/8d5a1314ec0f6a5b7f8ac27dfbf53ed82bf3fe > test-abc- For now, I am leaving the locks and while writting and reading file. It might cause error at some cases.
- No structure Error handling for now.
- Temparary Path approach for storing objects => will do it later.
- More robust Testing is needed. (Trying to implement it using GoogleTests.)
- The env variables approach need to change to config file approach.
- Checkout - Reset working directory to match branch
- Add - Stage specific files
- Merge - Merge branches
- Remote repositories - Push/pull to remote
- Tags - Create version tags
- Stash - Save work in progress
- Rebase - Rewrite commit history
- Delta encoding - Space-efficient storage
.yeetignore- Custom ignore patterns
- Option to choose which branch I want to make my new branch from. (Currently the new branch will automatically start from the prev branch ie the branch you were in)
- logic to reset the working directory to the target branch’s commit using tree traversal.
- Find solution of the problem: what if branches are changed? then how to check for changes?
- Design a new file structure
.diffto store the diffs content
- Store the File Size and Last Modified Time in your .yeet/Store (Index) file along with the path and OID.
Wall -Wextra -pedantic



