Skip to content

This is a lightweight version control system implemented in C as a hands-on project to understand how tools like Git work under the hood.

Notifications You must be signed in to change notification settings

AkshitLakhera/Version-control-pbl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”§ Simple Version Control System (VCS) in C

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.


βœ… Features Implemented

  • 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.

πŸ“ Folder Structure

Version-control-pbl/
β”œβ”€β”€ src/                 # Source code
β”‚   β”œβ”€β”€ main.c
β”‚   β”œβ”€β”€ vcs              # Compiled binary
β”‚   β”œβ”€β”€ vcs.h
β”‚   β”œβ”€β”€ Makefile
β”œβ”€β”€ test_files/          # Sample files for testing
β”œβ”€β”€ README.md            # Usage documentation

πŸ“¦ Setup Instructions

Follow these steps to set up and run the project on your system:

1. Clone the Repository

git clone <your-repo-link>
cd Version-control-pbl

2. Compile the Project

Navigate to the src directory and run make to build the project:

cd src
make

This will compile the code and generate the vcs executable inside the src/ directory.

3. (Optional) Add vcs to Your PATH

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.


πŸš€ Ready to Use!

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.

About

This is a lightweight version control system implemented in C as a hands-on project to understand how tools like Git work under the hood.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •