Skip to content

ayushsarode/orb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Orb

A custom implementation of the core Git version control system (orb) written in Go, and a web interface clone inspired by GitHub (orbhub) built with Next.js.

image

Overview

This project is primarily an ambitious learning exercise aimed at deeply understanding:

  1. Git Internals: How version control systems like Git work under the hood (objects, DAGs, index, refs, protocols).

Project Components

  1. orb (Go CLI):
    • Goal: To replicate core Git functionalities from the command line.
    • Implementation: Written purely in Go.
    • Focus: Understanding and implementing the Git object model (blobs, trees, commits), content-addressable storage, the index (staging area), refs (branches, HEAD), and eventually networking protocols (HTTP Smart Protocol).

Features (Planned / In Progress)

orb (Go CLI) - MVP Goals

  • orb init: Initialize a new .orb repository.
  • orb hash-object: Create blob objects from files.
  • orb add: Stage file changes (update the index).
  • orb write-tree: Create a tree object from the index.
  • orb commit-tree: Create a commit object.
  • orb commit: Create a commit (combining write-tree, commit-tree, and updating refs).
  • orb log: View commit history.
  • orb status: Show working directory and staging area status.

orb (Go CLI) - Future Goals

  • Branching (orb branch, orb checkout)
  • Merging
  • Diffing (orb diff)
  • Networking (orb clone, orb fetch, orb pull, orb push) via HTTP Smart Protocol
  • Networking via SSH Protocol
  • Garbage collection / Packing

Tech Stack

  • orb:
    • Language: Go
    • Core Libraries: Go Standard Library (os, crypto/sha1 or sha256, compress/zlib, net/http, etc.)
    • CLI Framework: cobra

Git Concepts I’ve Covered

  • Understand the Git object model: blob, tree, commit, tag
  • Learn how Git stores objects in .git/objects using SHA-1 hashes
  • Understand how refs (branches, tags) and HEAD work
  • Explore the index (staging area) and how it tracks changes
  • Grasp the structure of the commit graph (DAG) and how Git traverses history

About

A custom Version Control System built from scratch

Resources

License

Stars

Watchers

Forks

Packages

No packages published