Skip to content

Latest commit

Β 

History

History
113 lines (90 loc) Β· 3.21 KB

File metadata and controls

113 lines (90 loc) Β· 3.21 KB

πŸ”„ Version Control System (VCS)


πŸ“ŒIntroduction

Thank You to Uzairahmednasir for making this amazing project.
We are TEAM ENIGMA from DAU.
We have reaserched on this version-control-system project and its working under the course IT206 of DAU.
This project replicates some basic functions of version-control-systems like Git.


πŸš€ Features

  • πŸ—‚οΈ init: Initialize a new repository
  • βž• add <filename>: Stage files for the next commit
  • βœ… commit <message>: Commit changes with a message
  • πŸ“œ log: View commit history
  • βͺ revert <commit_id>: Revert to a previous version
  • 🧱 Organized structure using standard C++ and file I/O

🧰 Tech Stack

  • πŸ‘¨β€πŸ’» Language: C++
  • πŸ“ Concepts: File I/O, OOP, DSA
  • 🧠 Design: Modular, Lightweight, Educational

πŸ“ Project Structure

πŸ”„ version-control-system
 └──  Code Files                    β†’ πŸ’»Code Files 
        └── main.cpp
        └── commitNode.cpp
        └── gitClass.cpp

 └──  slides dsa project.pdf        β†’ ❀️‍πŸ”₯From Creator   
 └──  README.md                     β†’ πŸ“„Project documentation
 └──  working.png                   β†’ πŸ“Έ Screenshot of the application

Data Strcures Used

Data Structure Used Feature
Singly Linked List To maintain a chronological list of commits
Array of strings For adding multiple specific files to staging
Filesystem library (iterator) Traverse and copy files from working dir(like a directory traversal tool)
String Used for file paths, commit IDs, messages, dates

⚑ Getting Started

🧱 Prerequisites

  • Linux/Mac OS or WSL
  • A working C++ compiler (e.g., g++)

πŸ› οΈ Build Instructions

Compiling

g++ main.cpp

Commands
Note: Provide complete path of the file or open terminal in the folder where your file is.

./a.out init                          # Initialize a new repo
./a.out add notes.txt                 # Stage a file
./a.out commit -m "Commit Messege"    # Commit with a message
./a.out log                           # View commit history
./a.out revert <commit_id>            # Go back in time ⏳

Complete Procedure for running

Step 1: Compiling

g++ main.cpp

Step 2: Initializing Empty Repository

./a.out init

NOTE:- I am using wsl, if you are using Linux, a new hidden folder of ".git" will get created. You can check it by "la" command. init init NOTE:- Inside .git two new folders commits and staging_area are created, check them out by "ls" command.

Step 3: Add files to staging_area For example I am adding "gitClass.cpp" in staging_area.

./a.out add gitClass.cpp

init

Step 4: Commit Changes

./a.out commit -m "Changes Commited"

NOTE:- You can check folders inside commits folder for more details. init

Step 5: Display Commits

./a.out log

NOTE:- It displays all past commits info. init