Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitto - Git Implementation in Python

A functional Git implementation built from scratch to demonstrate Git's core architecture and object model.

🎥 Demo

gitto.mp4

Features

  • Object Storage: SHA-1 based content-addressable storage with zlib compression
  • Index Management: Full staging area implementation
  • Commits & History: Complete commit graph with parent tracking
  • Branches & Tags: Reference management for versions
  • Trees: Hierarchical file system representation
  • Status Tracking: Working tree and index status visualization

Usage

Initialize Repository

gitto init my-project
cd my-project

Stage & Commit

echo "content" > file.txt
gitto add file.txt
gitto commit -m "Initial commit"

View History

gitto log
gitto show-ref

Manage Tags

gitto tags v1.0
gitto tags -a v1.0

Commands

Plumbing Commands (Low-level):

  • gitto hash-object - Hash file objects
  • gitto cat-file - Display object content
  • gitto ls-tree - Show tree contents
  • gitto rev-parse - Parse revision identifiers

Porcelain Commands (High-level):

  • gitto init - Initialize repository
  • gitto add - Stage files
  • gitto commit - Record changes
  • gitto log - View commit history
  • gitto status - Show working tree status
  • gitto tags - Manage tags
  • gitto ls-files - List staged files
  • gitto show-ref - List all references
  • gitto branch - List or create branches
  • gitto checkout - Checkout commits
  • gitto rm - Remove files from index
  • gitto check-ignore - Check ignore rules

Project Structure

core/          # Git core functionality
commands/      # Command implementations
libgitto.py    # CLI parser
gitto          # Executable

Learning Value

Understanding:

  • Content-addressable object storage
  • Commit graph and history tracking
  • Staging area (index) mechanics
  • Reference management
  • Zlib compression for efficiency

Resources

About

A functional Git implementation built from scratch to demonstrate Git's core architecture and object model.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages