repo.object
Read the object database
Resolve refs and inspect loose or packed commits, trees, and blobs, including both Git delta encodings.
Version 0.3.0
Thuban reads and writes Git data directly from Ruby, then fetches and pushes local, smart HTTP, and SSH remotes through bounded transports.
Thuban keeps Git concepts visible. Ask for a ref, commit, tree, blob, or status entry and get a Ruby value back.
repo.object
Resolve refs and inspect loose or packed commits, trees, and blobs, including both Git delta encodings.
repo.status
Compare HEAD, the index, and the worktree while respecting repository ignore rules and linked worktrees.
repo.checkout
Replace worktree files atomically or switch branches only after Thuban rules out dirty files and path collisions.
require "thuban"
repo = Thuban::Repository.new(".")
repo.branch
# => "main"
repo.blob("README.md")
repo.status
repo.blame("lib/thuban.rb")
Diffing stays outside the reader. Thuban delegates line matching to Porrima, its only runtime dependency, and accepts an injected differ for blame.
Use staged_blob
and worktree_content
when you need to compare or restore text explicitly.
Thuban reads and writes local repositories, and transfers refs over local, smart HTTP, and SSH remotes. Fetches can report progress, limit history depth, or omit blobs. It targets SHA-1 repositories and the index and pack formats exercised by its test suite.
Start with the public API, then follow each Git object as far down as your application needs.