This assignment is an implementation of a Version Control System like Git in C++. The following commands are currently supported:
1. ./mygit init: initializes the repository
2. ./mygit hash-object: compresses a file and generates the SHA-1 hash
3. ./mygit cat-file: print metadata of a file
4. ./mygit write-tree: write the current directory structure to a tree
5. ./mygit ls-tree: show a tree file
6. ./mygit add <files>: add the files to the staging area
7. ./mygit commit -m <message>: commit the staged changes to the repo
8. ./mygit log: show logs of the commits that have been made
9. ./mygit checkout: checkout a particular commit of the repository
-
This project uses
zlibfor file compression. If it is not installed on the system, it should be installed by running:sudo apt install zlib1g zlib1g-dev -
Compile the source code using the Makefile:
aashrjai@aashrey-tuf: ~/<path>/20224202012_Assignment4$ make -
Run the desired command:
aashrjai@aashrey-tuf: ~/<path>/20224202012_Assignment4$ ./mygit <command>
The first command is always expected to be the ./mygit init command to initialize the repository.