Skip to content

๐Ÿ’พ A simplified C++ version control system inspired by Git โ€“ includes branching, merging, commit history, and diff functionality.

Notifications You must be signed in to change notification settings

Nati-Hab1/DSA-Final-Project-MiniGit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DSA-Final-Project-MiniGit

A simplified Git-like version control system built in C++.
MiniGit allows users to track versions of files, make commits, manage branches, perform merges, and compare commits โ€” all via command-line interaction and local file system operations.


๐Ÿš€ Features

โœ… init โ€“ Initialize a MiniGit repository
โœ… add <filename> โ€“ Stage a file for commit
โœ… commit -m "<message>" โ€“ Save staged changes with a message
โœ… log โ€“ View commit history
โœ… branch <branchname> โ€“ Create a new branch
โœ… checkout <branch/commit> โ€“ Switch to another branch or commit
โœ… merge <branch> โ€“ Merge a branch into the current branch
โœ… diff <commit1> <commit2> โ€“ Show differences between two commits


๐Ÿ“ Project Structure

MiniGit/
โ”œโ”€โ”€ MiniGit.cpp             # Full unified implementation
โ”œโ”€โ”€ test.txt, hello.txt     # Sample test files
โ”œโ”€โ”€ .minigit/               # MiniGit internal data
โ”‚   โ”œโ”€โ”€ objects/            # Stored file snapshots (by hash)
โ”‚   โ”œโ”€โ”€ commits/            # Commit metadata
โ”‚   โ”œโ”€โ”€ HEAD.txt            # Current branch pointer
โ”‚   โ”œโ”€โ”€ branches.txt        # Branch-to-commit map
โ”‚   โ””โ”€โ”€ index.txt           # Staging area

๐Ÿ› ๏ธ How to Compile

On Linux/macOS:

g++ -std=c++17 MiniGit.cpp -o MiniGit

On Windows (PowerShell or CMD):

g++ -std=c++17 MiniGit.cpp -o MiniGit.exe

๐Ÿ’ป How to Use

โž• Initialize Repository

./MiniGit init

๐Ÿ“„ Create and Add a File

echo Hello > hello.txt
./MiniGit add hello.txt

๐Ÿ“ Commit the File

./MiniGit commit -m "Initial commit"

๐Ÿ“œ View Commit Log

./MiniGit log

๐ŸŒฑ Create and Switch Branches

./MiniGit branch dev
./MiniGit checkout dev

๐Ÿ”€ Merge a Branch

./MiniGit checkout main
./MiniGit merge dev

๐Ÿงฎ Compare Commits

./MiniGit log  # get commit hashes
./MiniGit diff <commit1> <commit2>

๐Ÿงช Sample Files

The repo includes several trial files such as:

  • test.txt, hello.txt, file1.txt, etc.
  • These are used to demonstrate the add, commit, and diff functionality.

๐Ÿ“ฆ Final Version

  • โœ… Full functionality in a single MiniGit.cpp file
  • โœ… All group contributions merged into main branch
  • โœ… Sample test files and internal state included
  • โœ… Clean commit history for grading and review

๐Ÿ‘ฅ Contributors

This project was developed by 2nd-year Software Engineering students at Addis Ababa University:

  • Natnael Habteselassie
  • Wengelle Yohannes
  • Ezana Mulatu
  • Samuel Abraham
  • Omer Abubeker

๐Ÿ Project Status

โœ… Fully Completed
๐Ÿงช Tested with multiple sample runs
๐Ÿ“ Ready for final submission

About

๐Ÿ’พ A simplified C++ version control system inspired by Git โ€“ includes branching, merging, commit history, and diff functionality.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages