zub
A git-like content-addressed store for filesystem trees.
what it is
zub stores directory trees as content-addressed objects (blobs, trees, commits) with full metadata preservation: ownership, permissions, xattrs, sparse files, and hardlinks.
Similar to ostree's bare repo mode, blobs are stored uncompressed with metadata applied directly to the files, enabling hardlink-based checkout for zero-copy extraction.
why
- simpler than ostree
- supports user namespace remapping (rootless containers)
- union merging for layer composition
- efficient deduplication via content-addressing
install
build
# static binary via container (no dependencies needed)
# or locally
usage
# init a repo
# repo is auto-detected from ZUB_REPO env or .zub symlink/dir
# or
# commit a directory tree
# checkout (hardlinks by default)
# view history
# diff two refs
# merge multiple refs (last-wins on conflict)
# sync between repos (local or SSH)
commands
| command | description |
|---|---|
init |
create a new repository |
commit |
snapshot a directory into a ref |
checkout |
extract a ref to a directory |
log |
show commit history |
diff |
compare two refs |
ls-tree |
list tree contents |
union |
merge multiple refs |
push / pull |
sync refs between repositories (local or SSH) |
gc |
garbage collect unreachable objects |
fsck |
verify repository integrity |
remap |
translate blob ownership across namespaces |
stats / du |
repository statistics and disk usage |
Run zub --help for full command list.
repository layout
repo/
├── config.toml
├── objects/
│ ├── blobs/ # file content (uncompressed, with metadata)
│ ├── trees/ # directory structure (cbor + zstd)
│ └── commits/ # commit metadata (cbor + zstd)
└── refs/
├── heads/
└── tags/
license
MIT