Skip to content

AarambhDevHub/mini-git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mini Git - Local Git Implementation in Rust πŸ¦€

A complete, educational implementation of Git version control system written in Rust. Mini Git demonstrates Git's core concepts and internal workings through local repository operations, making it perfect for understanding how Git really works under the hood.

🎯 Educational Focus: Local-Only Implementation

Mini Git is intentionally designed for local operations only. This design choice allows you to:

  • 🧠 Learn Git internals without network protocol complexity
  • πŸ” See exactly how Git works with object stores, trees, and commits
  • πŸ—οΈ Understand distributed concepts through local repository simulation
  • πŸ“š Master Git fundamentals before tackling network implementations

βœ… What Mini Git Does (Fully Functional)

Complete Local Git Experience

  • Repository Management: init, clone (local paths)
  • Version Control: add, commit, status, log, diff
  • Branching & Merging: branch, checkout, merge with conflict detection
  • Local Remotes: push/pull between local repositories
  • Stashing: stash push/pop/list/show/drop/clear
  • Remote Management: Add/manage local repository references

Git-Compatible Object Storage

  • SHA-1 content addressing
  • Zlib-compressed objects
  • Tree and blob management
  • Complete commit history

❌ What Mini Git Doesn't Do

Network Operations Not Implemented

  • ❌ GitHub/GitLab: https://github.com/user/repo.git
  • ❌ SSH Remotes: git@github.com:user/repo.git
  • ❌ HTTP/HTTPS: Any network-based remote URLs
  • ❌ Git Protocols: git:// protocol support

For network operations, use standard Git alongside Mini Git.

πŸš€ Quick Start

Installation

git clone https://github.com/AarambhDevHub/mini-git.git
cd mini_git
cargo build --release

Basic Usage

# Initialize a repository
./target/release/mini_git init

# Add and commit files
echo "Hello, Mini Git!" > hello.txt
./target/release/mini_git add .
./target/release/mini_git commit -m "First commit" --author "You <you@example.com>"

# View history
./target/release/mini_git log
./target/release/mini_git status

πŸ—οΈ Architecture & Design

System Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          Mini Git Architecture                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User Interface β”‚    β”‚   Commands      β”‚    β”‚   Core Engine   β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚    CLI      ││─────  β”‚    init     β”‚β”‚    β”‚  β”‚ Object Storeβ”‚β”‚
β”‚  β”‚   (clap)    β”‚β”‚    β”‚  β”‚    add      β”‚β”‚    β”‚  β”‚   (SHA-1)   β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚    β”‚  β”‚   commit    β”‚β”‚    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β”‚                 β”‚    β”‚  β”‚   status    β”‚β”‚    β”‚                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚    β”‚  β”‚    log      β”‚β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
β”‚  β”‚ Subcommands β”‚β”‚    β”‚  β”‚   branch    ││─────  β”‚ Repository  β”‚β”‚
β”‚  β”‚   Parser    β”‚β”‚    β”‚  β”‚  checkout   β”‚β”‚    β”‚  β”‚   Utils     β”‚β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚    β”‚  β”‚   merge     β”‚β”‚    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β”‚   clone     β”‚β”‚    β”‚                 β”‚
                       β”‚  β”‚   push      β”‚β”‚    β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”‚
                       β”‚  β”‚   pull      β”‚β”‚    β”‚  β”‚   Index     β”‚β”‚
                       β”‚  β”‚  remote     β”‚β”‚    β”‚  β”‚ Management  β”‚β”‚
                       β”‚  β”‚   stash     β”‚β”‚    β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
                       β”‚  β”‚   diff      β”‚β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β”‚
                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        Data Flow Architecture                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Working Directory     Index (Staging)      Object Database      References
─────────────────     ───────────────      ───────────────      ──────────

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   file1.txt β”‚       β”‚  Staged     β”‚      β”‚   Objects   β”‚      β”‚  HEAD   β”‚
β”‚   file2.py  β”‚ ────► β”‚  Changes    β”‚ ───► β”‚             β”‚ ◄──► β”‚         β”‚
β”‚   README.md β”‚  add  β”‚             β”‚commitβ”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚      β”‚ refs/   β”‚
β”‚     ...     β”‚       β”‚ JSON Index  β”‚      β”‚ β”‚  Blob   β”‚ β”‚      β”‚ heads/  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚   Format    β”‚      β”‚ β”‚  Tree   β”‚ β”‚      β”‚  main   β”‚
                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚ β”‚ Commit  β”‚ β”‚      β”‚ feature β”‚
                                           β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚             β”‚
                      β”‚  Stash      β”‚      β”‚ Compressed  β”‚      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                      β”‚  Storage    β”‚ ───► β”‚ (zlib)      β”‚      β”‚ Remote  β”‚
                      β”‚             β”‚      β”‚ SHA-1 Hash  β”‚      β”‚ Trackingβ”‚
                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Object Store Structure

.mini_git/
β”œβ”€β”€ objects/                    # Git Object Database
β”‚   β”œβ”€β”€ 12/                    # Directory: First 2 chars of SHA-1
β”‚   β”‚   └── 3456789abcdef...   # File: Remaining 38 chars (zlib compressed)
β”‚   β”œβ”€β”€ ab/
β”‚   β”‚   β”œβ”€β”€ cdef1234567...     # Blob object (file content)
β”‚   β”‚   └── 9876543210a...     # Tree object (directory structure)
β”‚   └── de/
β”‚       └── f123456789b...     # Commit object (snapshot + metadata)
β”‚
β”œβ”€β”€ refs/                      # Reference Storage
β”‚   β”œβ”€β”€ heads/                 # Local branch pointers
β”‚   β”‚   β”œβ”€β”€ main              # Points to commit SHA-1
β”‚   β”‚   └── feature           # Points to commit SHA-1
β”‚   └── remotes/              # Remote tracking branches
β”‚       └── origin/           # Remote named 'origin'
β”‚           β”œβ”€β”€ main          # Tracks remote main branch
β”‚           └── feature       # Tracks remote feature branch
β”‚
β”œβ”€β”€ index                     # Staging Area (JSON format)
β”œβ”€β”€ HEAD                      # Current branch pointer
β”œβ”€β”€ config                    # Repository configuration
└── stash                     # Stashed changes (JSON array)

Data Model Relationships

Commit Object                 Tree Object                 Blob Object
─────────────                ─────────────               ─────────────

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ hash: abc123... β”‚          β”‚ hash: def456... β”‚         β”‚ hash: 789xyzβ”‚
β”‚ parent: xyz789..β”‚ ────────►│ entries: {      β”‚ ──────► β”‚ content:    β”‚
β”‚ tree: def456... β”‚          β”‚   "file.txt": { β”‚         β”‚ "Hello\n"   β”‚
β”‚ author: "Name"  β”‚          β”‚     mode: "644" β”‚         β”‚             β”‚
β”‚ message: "Fix"  β”‚          β”‚     hash: 789xyzβ”‚         β”‚             β”‚
β”‚ timestamp: ...  β”‚          β”‚     is_file: T  β”‚         β”‚             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚   },            β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                    β”‚   "src/": {     β”‚
        β”‚                    β”‚     mode: "040" β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                    β”‚     hash: sub123│────────►│ hash: sub123β”‚
        └───► Parent         β”‚     is_file: F  β”‚         β”‚ entries: {  β”‚
              Commit         β”‚   }             β”‚         β”‚   "main.rs" β”‚
                            β”‚ }               β”‚         β”‚   ...       β”‚
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                            β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                            β”‚ Subdirectory    β”‚
                            β”‚ Tree Object     β”‚
                            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Command Execution Flow

User Input β†’ CLI Parser β†’ Command Router β†’ Core Operations β†’ Storage

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ mini_git    β”‚   β”‚    Clap     β”‚   β”‚  Command    β”‚   β”‚  Object     β”‚
β”‚ add file.txt│──►│   Parser    │──►│  Executor   │──►│  Store      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                           β”‚
Example Flow:                              β–Ό
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
1. add file.txt   β”‚                Command Processing                  β”‚
   β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β–Ό                                      β”‚
2. Parse args     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β–Ό         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚              β”‚ Read File   β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Update      β”‚
   β–Ό              β”‚ Content     │───►│ Calculate   β”‚β–Ίβ”‚ Index       β”‚
3. Load file      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ SHA-1 Hash  β”‚ β”‚ (Staging)   β”‚
   β”‚                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β–Ό                                        β”‚
4. Hash content   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β–Ό         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚              β”‚ Compress    β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚ Success     β”‚
   β–Ό              β”‚ with zlib   │───►│ Store Blob  │─►│ Message     β”‚
5. Store object   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ Object      β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β”‚                                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β–Ό
6. Update index

πŸ“– Complete Local Workflows

1. Basic Development

# Start a project
mkdir my_project && cd my_project
mini_git init

# Create files and track changes
echo "# My Project" > README.md
echo "fn main() { println!(\"Hello!\"); }" > main.rs
mini_git add .
mini_git commit -m "Initial commit"

# Check project state
mini_git status
mini_git log

2. Feature Branch Development

# Create feature branch
mini_git branch feature-auth
mini_git checkout feature-auth

# Develop feature
echo "Authentication module" > auth.rs
mini_git add auth.rs
mini_git commit -m "Add authentication"

# Merge back to main
mini_git checkout main
mini_git merge feature-auth
mini_git branch feature-auth --delete

3. Simulated Team Development (Local)

# Create "central" repository
mkdir team_project && cd team_project
mini_git init
echo "Team Project" > README.md
mini_git add . && mini_git commit -m "Project start"

# Developer A
cd .. && mini_git clone team_project dev_alice
cd dev_alice
echo "Alice's feature" > feature_a.py
mini_git add . && mini_git commit -m "Add feature A"
mini_git push origin main

# Developer B
cd .. && mini_git clone team_project dev_bob
cd dev_bob
mini_git pull origin main  # Gets Alice's changes
echo "Bob's feature" > feature_b.py
mini_git add . && mini_git commit -m "Add feature B"
mini_git push origin main

# Alice syncs latest changes
cd ../dev_alice
mini_git pull origin main
ls  # See both features: feature_a.py, feature_b.py

4. Stash Workflow

# Working on something...
echo "Work in progress..." > unfinished.txt
mini_git add unfinished.txt

# Need to switch context quickly
mini_git stash push -m "WIP: new feature"
mini_git checkout other-branch

# Later, restore work
mini_git checkout main
mini_git stash pop  # Restores unfinished.txt

# Or manage multiple stashes
mini_git stash list
mini_git stash show 0
mini_git stash drop 0

πŸ”§ Commands Reference

Repository Operations

mini_git init                    # Initialize repository
mini_git clone <local_path> <dir> # Clone local repository
mini_git status                  # Show working directory status

Staging & Committing

mini_git add <files>             # Stage files
mini_git add .                   # Stage all files
mini_git commit -m "message"     # Create commit
mini_git commit -m "msg" --author "Name <email>"  # With author

History & Inspection

mini_git log                     # Show commit history
mini_git log --max-count 5       # Limit number of commits
mini_git diff                    # Show unstaged changes
mini_git diff <files>            # Diff specific files

Branching

mini_git branch                  # List branches
mini_git branch <name>           # Create branch
mini_git branch <name> --delete  # Delete branch
mini_git checkout <branch>       # Switch branches
mini_git merge <branch>          # Merge branch into current

Local Remotes

mini_git remote                  # List remotes
mini_git remote -v               # List with URLs
mini_git remote add <name> <local_path>  # Add local remote
mini_git remote remove <name>    # Remove remote
mini_git remote set-url <name> <path>    # Change remote URL
mini_git push <remote> <branch>  # Push to local remote
mini_git pull <remote> <branch>  # Pull from local remote

Stashing

mini_git stash                   # Stash current changes
mini_git stash push -m "message" # Stash with message
mini_git stash list              # List all stashes
mini_git stash show              # Show latest stash
mini_git stash pop               # Apply and remove latest stash
mini_git stash drop              # Delete a stash
mini_git stash clear             # Delete all stashes

πŸ§ͺ Testing

Automated Test Suite

chmod +x test_minigit.sh
./test_minigit.sh

Tests cover:

  • βœ… Basic repository operations
  • βœ… Branching and merging
  • βœ… Local clone/push/pull workflows
  • βœ… Stash functionality
  • βœ… Remote management
  • βœ… Object store integrity
  • βœ… Error handling

Manual Testing

# Quick functionality test
mkdir test && cd test
mini_git init
echo "test" > file.txt
mini_git add . && mini_git commit -m "test"
mini_git log

🌐 Working with Network Remotes

Since Mini Git is local-only, here's how to work with GitHub/GitLab:

Option 1: Develop Locally, Publish with Git

# Develop with Mini Git
mini_git add . && mini_git commit -m "Feature complete"

# Publish with standard Git
git init  # Initialize Git in same directory
git remote add origin https://github.com/user/repo.git
git add . && git commit -m "Feature complete"
git push origin main

Option 2: Hybrid Workflow

# Use Mini Git for local development and learning
mini_git branch feature && mini_git checkout feature
mini_git add . && mini_git commit -m "Local development"

# Use Git for collaboration
git checkout main && git pull origin main
git merge feature && git push origin main

πŸ“ Project Structure

mini_git/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.rs           # CLI interface
β”‚   β”œβ”€β”€ lib.rs            # Core types
β”‚   β”œβ”€β”€ object_store.rs   # Git object storage
β”‚   β”œβ”€β”€ utils.rs          # Repository utilities
β”‚   └── commands/         # Command implementations
β”‚       β”œβ”€β”€ init.rs       # Repository initialization
β”‚       β”œβ”€β”€ add.rs        # Staging operations
β”‚       β”œβ”€β”€ commit.rs     # Commit creation
β”‚       β”œβ”€β”€ status.rs     # Working directory status
β”‚       β”œβ”€β”€ log.rs        # History viewing
β”‚       β”œβ”€β”€ branch.rs     # Branch management
β”‚       β”œβ”€β”€ checkout.rs   # Branch switching
β”‚       β”œβ”€β”€ merge.rs      # Three-way merge
β”‚       β”œβ”€β”€ diff.rs       # File differences
β”‚       β”œβ”€β”€ clone.rs      # Local cloning
β”‚       β”œβ”€β”€ push.rs       # Local push operations
β”‚       β”œβ”€β”€ pull.rs       # Local pull operations
β”‚       β”œβ”€β”€ remote.rs     # Remote management
β”‚       └── stash.rs      # Stash operations
β”œβ”€β”€ Cargo.toml           # Dependencies
β”œβ”€β”€ test_minigit.sh      # Test suite
└── README.md           # This file

πŸŽ“ Learning Objectives

By using Mini Git, you'll understand:

  1. Git Object Model: How commits, trees, and blobs work
  2. Content Addressing: Why Git uses SHA-1 hashes
  3. Distributed Architecture: How multiple repositories sync
  4. Merge Algorithms: Three-way merge and conflict resolution
  5. Index Mechanics: How the staging area works
  6. Reference Management: Branches, tags, and HEAD
  7. Data Integrity: How Git ensures data consistency

πŸ”§ Dependencies

[dependencies]
sha1 = "0.10"           # SHA-1 hashing for content addressing
serde = "1.0"           # Serialization framework
serde_json = "1.0"      # JSON support for objects
chrono = "0.4"          # Date and time handling
clap = "4.0"            # Command-line argument parsing
walkdir = "2.3"         # Directory tree traversal
flate2 = "1.0"          # Zlib compression for objects

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for your changes
  4. Ensure all tests pass (./test_minigit.sh)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“š Further Learning

πŸ“œ License

MIT License - see LICENSE file for details.

β˜• Support & Community

If you find Ignitia helpful, consider supporting the project:

Buy Me A Coffee

πŸ™ Acknowledgments

  • Git community for excellent design and documentation
  • Rust community for amazing development tools
  • Educational Git resources that inspired this implementation

Made with ❀️ and πŸ¦€ Rust ❀️ by Aarambh Dev Hub

🎯 Mini Git: Learn Git by building Git, one commit at a time!

Perfect for students, developers, and anyone curious about how Git really works under the hood.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published

Languages