Built a mini version control system. Every change to the code is recorded by version control software in a particular form of database. When a mistake is made, engineers can go back to an earlier version of the code to help correct it with the least amount of interruption to the entire team.
Implemented commands like 'init', 'add', 'commit', 'log', 'status, 'diff', 'rollback', 'retrieve -a' and 'retrieve SHA'.
Github link - https://github.com/samyakjain20/Mini-Version-Control-System
./vcs init
This command will create a .vcs repository and the required structure. This folder will contain all the version control information.
./vcs status
The following command will show the status of the current working tree. Initially all will be untracked.
./vcs add .
This command will add the file/files in the current directory to the staging area.
./vcs commit “first commit”
The following command will commit all the files in the staging area.
./vcs diff temp.txt
The following command shows the difference for temp.txt. As described above.
./vcs log
The following command will log all the previous commit data.
./vcs rollback 76931fa
This will first commit the current staging area, and then rollback to the version corresponding to the commit id given.
./vcs retrieve -a 0
This command will return the “commit id” of the version no, if the version no is valid.
./vcs retrieve SHA 0
This command will return the “commit SHA” of the version no, if the version no is valid.