A lightweight custom version control system built in C. It allows you to track changes to files, make commits, view logs, and revert back to previous versions β all from your terminal.
initβ Initialize a new repository.add <filename>β Add file to staging (index).commit <message>β Save snapshot of staged files.logβ View commit history.statusβ Check file changes since last commit.checkout <commit_id>β Revert files to a previous commit state.
Version-control-pbl/
βββ src/ # Source code
β βββ main.c
β βββ vcs # Compiled binary
β βββ vcs.h
β βββ Makefile
βββ test_files/ # Sample files for testing
βββ README.md # Usage documentationFollow these steps to set up and run the project on your system:
git clone <your-repo-link>
cd Version-control-pblNavigate to the src directory and run make to build the project:
cd src
makeThis will compile the code and generate the vcs executable inside the src/ directory.
To use vcs from anywhere in the terminal:
export PATH=$PATH:$(pwd)You can also add this line to your shell config (~/.bashrc, ~/.zshrc, etc.) for persistence.
Now you're ready to use your custom VCS. Try commands like:
vcs init
vcs add <filename>
vcs commit "Initial commit"
vcs log
vcs status
vcs checkout <commit_id>Refer to the Usage Guide below for detailed command usage.