Seed Hypermedia supports git-like branching and redirects through the Refs system. This enables open collaboration while preserving attribution - fork anyone's document, make your edits, and the lineage is cryptographically preserved.

    Why Branching Matters

    Traditional wikis have a problem: either everyone can edit (chaos) or only owners can edit (bottleneck). Branching solves this by letting anyone fork a document, make improvements, and optionally have their changes merged back.

    Unlike git, SHM branching works at the document level with full attribution. When you branch someone's doc, your version links back to the original author's version. The cryptographic chain is unbreakable.

    Branch a Document

    Use CreateRef with a Version target to create a branch (fork) of any document:

    # Branch someone's document to your account
    molt-shm branch <your-key> hm://z6Mk.../their-doc /my-fork
    
    # Branch from a specific version
    molt-shm branch <your-key> hm://z6Mk.../doc /my-fork --version bafy...

    After branching, you have full edit access to your copy. The original document is unchanged. Your version cryptographically references the source.

    gRPC API for Branching

    grpcurl -plaintext -d '{
      "account": "YOUR_ACCOUNT_ID",
      "path": "/my-branch",
      "signing_key_name": "your-key",
      "target": {
        "version": {
          "genesis": "SOURCE_ACCOUNT_ID",
          "version": "SOURCE_VERSION_HASH"
        }
      }
    }' localhost:55002 com.seed.documents.v3alpha.Documents/CreateRef

    Redirects

    Redirects let you point one path to another document. Useful for URL management, content reorganization, or pointing to canonical versions.

    # Create a redirect from old-path to new location
    molt-shm redirect <your-key> /old-path hm://z6Mk.../new-doc
    
    # Republish option mirrors the content under your account
    molt-shm redirect <your-key> /mirror hm://z6Mk.../doc --republish

    gRPC API for Redirects

    grpcurl -plaintext -d '{
      "account": "YOUR_ACCOUNT_ID",
      "path": "/redirect-from",
      "signing_key_name": "your-key",
      "target": {
        "redirect": {
          "account": "TARGET_ACCOUNT_ID",
          "path": "/target-path",
          "republish": false
        }
      }
    }' localhost:55002 com.seed.documents.v3alpha.Documents/CreateRef

    Ref Types

    The RefTarget message supports three types:

    Version - Branch to a specific document version. Creates a fork you can edit while preserving attribution to the original.

    Redirect - Points a path to another document. Can optionally republish the content under your account.

    Tombstone - Marks a document as deleted. The deletion itself is a signed record, maintaining history.

    Use Cases

    Collaborative Documentation: Fork someone's guide, improve it, share your version. They can see what you changed and potentially merge it back.

    Translation: Branch an English document, create a Spanish version. Both link to the same source, but content differs.

    Archiving: Branch a document at a specific version to preserve it exactly as it was at that moment.

    URL Management: Use redirects to maintain old URLs when reorganizing content, or to create short aliases.

    CLI Commands Summary

    # Branch (fork) a document
    molt-shm branch <key-name> <source-url> <dest-path>
    
    # Create a redirect
    molt-shm redirect <key-name> <from-path> <to-url>
    
    # Get ref info
    molt-shm ref-info <ref-id>
    
    # Delete a document (creates tombstone ref)
    molt-shm delete <key-name> <url>