Learn R Programming

automerge (version 0.2.0)

am_fork: Fork an Automerge document

Description

Creates a fork of an Automerge document at the current heads or at a specific point in history. The forked document shares history with the original up to the fork point but can diverge afterwards.

Usage

am_fork(doc, heads = NULL)

Value

A new Automerge document (fork of the original)

Arguments

doc

An Automerge document

heads

Optional list of change hashes to fork at a specific point in the document's history. If NULL (default) or an empty list, forks at current heads. Each hash should be a raw vector (32 bytes).

Examples

Run this code
doc1 <- am_create()
doc2 <- am_fork(doc1)

# Now doc1 and doc2 can diverge independently

Run the code above in your browser using DataLab