This is a distribted version control system similar to git.
My motivation behind it to learn more about internals of Git, and also advance my knowledge and practice writing code in C/C++ language.
The architecture i followed to build this version control system is very much simailar to git. In this architecture every file is treated as BLOB
and every directory is treated as a TREE a tree may conatin either one or more blobs and it may also contain another tree.
First when the command <executable> init is being run it will create a folder named .jh this folder contains
different information about the repository. When the programmer runs <executable> commit "<commit-message>" it first compresses the blob data and creates a unique
hash id after which the compressed data is stored in .jh/objects folder, similarly tree is also compreesed conationg information
like blob name, blob hash is stored in .jh/objects.
For further inqiry please visit git internals.
In Debian/Linux bash
sudo apt-get update
sudo apt-get install libssl-dev zlib1g-dev
If you have already installed git, there is high probability that prequisite libraries zlib and libssl are already installed
-
First create the exectable by running the command
make -
After exectable has been created, run command
<executable> init <folder-name>.for default root folder where the local repo will be created this command Initializes the repository, the executable isjh-vcs, located in build foldermake cleanremoves delete folder -
After Initializing the repository run command
<executable> commit "<commit-message>"to commit changes to the repository. -
Run command
<executable> logto see all the commits with its hashes -
To restore your working directory to different commit run command
<executable> reset <hash>. -
Run command
make cleanto delete*.o(object files)files and executable (optional)
-
<executable> hash-object <filename>this command compresses the files using zlib compression and then createshashof that compressed data -
<executable> cat-file <hash>to see contains of file which is stored in.jh/objects -
<executable> ls-tree <folderpath> -wto create a tree object
This program is written in C/C++ and tested in Debian/Linux before running it in windows or any other operating you may have to change some code. Even though i tried my best to write croos-platform code Thanks