How jelmer/dulwich works
Dulwich is a pure-Python Git library with a porcelain command layer and a lower-level repository API. A typical local workflow enters through the CLI or porcelain, reads or changes a repository’s working tree, index, objects, and refs, then reports results. Remote workflows use the client protocol to exchange refs and pack data, while server handlers expose repositories to peers. The README documents these API layers and Git compatibility; several subsystem links below reflect module roles and documented capabilities rather than inspected call sites.
Main entry points: __init__.py Porcelain API · repo.py Repository API · object_store.py Object store · server.py Git server
Components 21
User Interfaces
- CLI
dulwich/cli.py - Porcelain API
dulwich/porcelain/__init__.py
Local Repository
- Repository API
dulwich/repo.py - Index
dulwich/index.py - Working tree
dulwich/worktree.py - Refs and reflogs
dulwich/refs.py
Git Data Operations
- Git objects
dulwich/objects.py - Object store
dulwich/object_store.py - Pack files
dulwich/pack.py - Diff and merge
dulwich/diff.py - History traversal
dulwich/walk.py - Archive output
dulwich/archive.py
Remote Protocols
- Git client
dulwich/client.py - Wire protocol
dulwich/protocol.py - Git server
dulwich/server.py - HTTP server
dulwich/aiohttp/server.py
Storage Integrations
- GCS object store
dulwich/cloud/gcs.py - Swift backend
contrib/swift.py
Other components
- Git library user
- Git peer
- Cloud storage
Connections 23
- Git library user → CLI: runs commands
- Git library user → Porcelain API: calls API
- CLI → Porcelain API: dispatches commands
- Porcelain API → Repository API: uses repository
- Repository API → Object store: accesses objects
- Repository API → Refs and reflogs: manages refs
- Porcelain API → Index: updates staging
- Porcelain API → Working tree: changes files
- Index → Object store: stages objects
- Object store → Git objects: stores objects
- Object store → Pack files: reads and writes packs
- Porcelain API → Diff and merge: computes changes
- Porcelain API → History traversal: traverses history
- Porcelain API → Archive output: exports repository
- Git client → Wire protocol: exchanges Git data
- Git client → Repository API: updates local repository
- Git client → Git peer: fetches or pushes
- Git peer → Git server: requests repository service
- Git server → Wire protocol: handles wire messages
- Git server → Repository API: serves repository
- HTTP server → Git server: dispatches services
- GCS object store → Cloud storage: reads and writes blobs
- Swift backend → Cloud storage: stores repository data