Skip to content

forkpress branch

forkpress branch manages materialized WordPress branches, merges, merge audit records, and conflict review.

Use it after forkpress init and forkpress serve to create previews, merge work back to main, and review conflicts with auditable choices.

Usage

Terminal window
forkpress branch [--work-dir <path>] [--php-bin <path>] <command> [options]

forkpress branchctl is an alias for this command. See forkpress branchctl.

Shared Options

OptionDefaultDescription
--work-dir <path>.forkpressSite state directory whose branches should be managed.
--php-bin <path>Embedded PHPPHP binary used for runtime helpers and merge operations.
-h, --helpNonePrint branch help. Also works as forkpress branch <command> --help.

Branch Lifecycle

SubcommandPurpose
listPrint all materialized branches for this site.
show [branch]Show storage details for one branch. Defaults to main.
status [branch]Alias for show.
create <branch>Create a branch from another branch. Defaults to --from main.
reset <branch>Replace a branch with a fresh copy of another branch.
rollback <branch>Alias for reset.
delete <branch>Delete a branch other than main.
rm <branch>Alias for delete.

list

Terminal window
forkpress branch list

Prints one branch name per line.

show

Terminal window
forkpress branch show [branch]
ArgumentDefaultDescription
branchmainBranch to inspect.

show prints the branch directory, database path, file count, and related storage metadata.

create

Terminal window
forkpress branch create <new-branch> [--from <source>]
OptionDefaultDescription
--from <source>mainSource branch to copy into the new branch.

Example:

Terminal window
forkpress branch create marketing --from main

reset

Terminal window
forkpress branch reset <branch> --from <source> [--force]
OptionRequiredDescription
--from <source>YesSource branch to copy over the target branch.
--forceNoAllow resetting main.

reset replaces the target branch directory and database with a fresh copy-on-write clone of the source branch.

delete

Terminal window
forkpress branch delete <branch>

Deletes a materialized branch. main cannot be deleted.

Merge Commands

SubcommandPurpose
merge <source> --into <target>Merge one branch into another and record audit metadata.
historyShow merge runs as source-to-target edges.
merge-historyAlias for history.
treeShow the same merge edge data for topology-oriented review.
recover-crashInspect or restore pending merge crash-recovery artifacts.
merge-recoverAlias for recover-crash.

merge

Terminal window
forkpress branch merge <source> --into <target> [--plugin-validator <path>]
OptionRequiredDescription
--into <target>YesTarget branch that receives source changes.
--plugin-validator <path>NoRun one plugin validator before reporting merge completion.

Example:

Terminal window
forkpress branch merge feature --into main

ForkPress records merge run metadata, decisions, conflicts, resolutions, and crash-recovery state in the COW merge audit database. If generic merge logic cannot safely choose a result, the merge can complete with reviewable conflicts rather than silently inventing a repair.

history And tree

Terminal window
forkpress branch history [--run <id>] [--limit <n>] [--format text|json]
forkpress branch tree [--run <id>] [--limit <n>] [--format text|json]
OptionDefaultDescription
--run <id>NoneShow one merge run.
--limit <n>20Number of recent runs to print.
--format text|jsontextOutput format.

recover-crash

Terminal window
forkpress branch recover-crash [--run <id>] [--restore-target-db] [--restore-files] [--format text|json]
OptionDefaultDescription
--run <id>NoneLimit recovery inspection or restore to one merge run.
--restore-target-dbDisabledRestore the pre-merge target database from crash-recovery artifacts.
--restore-filesDisabledRestore pre-merge target files from crash-recovery artifacts.
--format text|jsontextOutput format.

Run it without restore flags first to inspect pending artifacts:

Terminal window
forkpress branch recover-crash

Audit And Conflict Review

SubcommandPurpose
merge-auditInspect merge runs, decisions, conflicts, events, resolutions, rollback failures, and crash recovery.
auditAlias for merge-audit.
conflictsShortcut for merge-audit --records conflicts.
merge-reviewAttach review metadata to audit records.
merge-resolveValidate or apply a conflict choice.
revalidate-reviewsRecheck reviewed conflicts against current target state.
merge-revalidateAlias for revalidate-reviews.
merge-apply-reviewedApply validated, unapplied generic conflict resolutions.

merge-audit

Terminal window
forkpress branch merge-audit [options]
OptionDefaultDescription
--format text|jsontextOutput format.
--limit <n>20Maximum rows per record type where a limit applies.
--run <id>NoneFilter to one merge run.
--scope all|db|files|pluginallLimit audit output by merge domain.
--records all|runs|conflicts|conflict-events|decisions|resolutions|rollback-failures|crash-recoveryallRecord family to print.
--conflict-type <type>NoneFilter conflicts by conflict type.
--conflict-id <id>NoneFilter to one conflict id. Cannot be combined with --conflict-key when revalidating.
--conflict-key <key>NoneFilter by logical conflict key. Cannot be combined with --conflict-id when revalidating.
--event-type <type>NoneFilter conflict events. Values include recorded, review-pending, review-needs-action, review-reviewed, resolution-validated, resolution-applied, resolution-blocked, and revalidation-required.
--plugin <name>NoneFilter plugin-scoped conflicts by plugin name.
--plugin-object <object>NoneFilter plugin-scoped conflicts by plugin object.
--plugin-severity info|warning|error|criticalNoneFilter plugin-scoped conflicts by severity.
--plugin-logical-identity <json>NoneFilter plugin-scoped conflicts by logical identity JSON.
--decision <value>NoneFilter merge decisions.
--path <path>NoneFilter by relative file path.
--path-prefix <path>NoneFilter by relative file path prefix.
--id-band-skipsDisabledShow ID-band skip records.
--target-keptDisabledShow records where target state was kept.
--reviewDisabledInclude review-focused audit output.
--review-status <status>NoneFilter by unreviewed, pending, needs-action, or reviewed.
--resolution-status validated|appliedNoneFilter resolution records.
--lifecycle-state <state>NoneFilter by unreviewed, deferred, needs-action, reviewed, validated, or resolved.
--next-action <action>NoneFilter by review, run-plugin-validator, wait, revalidate, resolve, apply-reviewed-choice, manual-review, or none.
--revalidation-class <class>NoneFilter by revalidation class, such as unchanged, compatible-target-drift, missing, incompatible, or replacement-evidence.
--latest-revalidation-status <status>NoneFilter by none, current, source-drifted, target-drifted, source-and-target-drifted, or unknown.
--stale-status fresh|stale|error|unknownNoneFilter reviewed conflicts by stale status.
--resolution-choice source|target|plugin-driverNoneFilter conflicts or resolutions by available or selected choice.
--blocked-resolution-choice source|targetNoneFilter conflicts where a choice is visible but blocked.
--resolution-strategy <strategy>NoneFilter by manual-review, plugin-validator, schema-choice, file-choice, row-choice, or cell-choice.
--generic-resolver yes|noNoneFilter conflicts by generic resolver support.
--after-revalidate supported|unsupportedNoneFilter by whether after-revalidate application is supported.
--group-by <field>noneGroup output. Supported fields include table, status, path, type, severity, lifecycle, event-type, next-action, conflict-key, resolution-strategy, generic-resolver, after-revalidate, revalidation-class, latest-revalidation-status, stale-status, plugin, plugin-object, plugin-severity, and plugin-logical-identity.
--revalidateDisabledRevalidate reviewed conflicts instead of printing audit output. Only accepts --run, --conflict-id, --conflict-key, --reviewer, --format, and --quiet.
--reviewer <name>NoneReviewer name for --revalidate.
--quietDisabledSuppress nonessential output for --revalidate.

conflicts

Terminal window
forkpress branch conflicts [options]

conflicts accepts the same options as merge-audit, but defaults --records to conflicts.

Examples:

Terminal window
forkpress branch conflicts --run 42
forkpress branch conflicts --run 42 --lifecycle-state needs-action
forkpress branch conflicts --run 42 --group-by next-action

merge-review

Terminal window
forkpress branch merge-review <conflict|decision|resolution> <id> --status <pending|needs-action|reviewed> --note <text> [--reviewer <name>]
forkpress branch merge-review conflict-key <key> [--run <id>] --status <pending|needs-action|reviewed> --note <text> [--reviewer <name>]
OptionRequiredDescription
--status pending|needs-action|reviewedYesReview status to attach.
--note <text>YesHuman review note.
--reviewer <name>NoReviewer name.
--run <id>Only for conflict-keyDisambiguate a logical conflict key.

merge-resolve

Terminal window
forkpress branch merge-resolve conflict <id> (--choice <source|target> [--apply]|--apply-reviewed) [--after-revalidate] [--note <text>] [--reviewer <name>]
forkpress branch merge-resolve conflict-key <key> [--run <id>] (--choice <source|target> [--apply]|--apply-reviewed) [--after-revalidate] [--note <text>] [--reviewer <name>]
OptionRequiredDescription
--choice source|targetYes, unless --apply-reviewed is usedValidate the chosen side.
--applyNoApply the chosen side immediately after validation.
--apply-reviewedAlternative to --choiceApply the latest validated choice. Cannot be combined with --choice or --apply.
--after-revalidateNoAllow application after compatible target drift has been revalidated.
--note <text>NoResolution note.
--reviewer <name>NoReviewer name.
--run <id>Only for conflict-keyDisambiguate a logical conflict key.

revalidate-reviews

Terminal window
forkpress branch revalidate-reviews [--run <id>] [--conflict-id <id>|--conflict-key <key>] [--reviewer <name>] [--format text|json] [--quiet]
OptionDefaultDescription
--run <id>NoneRevalidate conflicts for one merge run.
--conflict-id <id>NoneRevalidate one conflict id. Cannot be combined with --conflict-key.
--conflict-key <key>NoneRevalidate one logical conflict key. Cannot be combined with --conflict-id.
--reviewer <name>NoneReviewer name recorded for revalidation events.
--format text|jsontextOutput format.
--quietDisabledSuppress nonessential output.

merge-apply-reviewed

Terminal window
forkpress branch merge-apply-reviewed [--run <id>] [--limit <n>] [--note <text>] [--reviewer <name>] [--format text|json]
OptionDefaultDescription
--run <id>NoneApply validated choices for one merge run.
--limit <n>NoneMaximum number of resolutions to apply.
--note <text>NoneResolution note.
--reviewer <name>NoneReviewer name.
--format text|jsontextOutput format.

Inspect candidates first:

Terminal window
forkpress branch merge-audit --next-action apply-reviewed-choice

Plugin Validators And Drivers

SubcommandPurpose
run-plugin-validatorRun one plugin validator for a merge run and record emitted findings.
record-plugin-validator-conflictsRecord plugin-scoped validator findings from JSON.
run-plugin-driverRun one plugin merge driver for a conflict and record its result.
record-plugin-driver-resolutionRecord first-class audit evidence from a plugin-specific merge driver.

run-plugin-validator

Terminal window
forkpress branch run-plugin-validator --run <id> --validator <path> [--format text|json]
OptionRequiredDescription
--run <id>YesMerge run id.
--validator <path>YesValidator executable or script.
--format text|jsonNoOutput format. Defaults to text.

record-plugin-validator-conflicts

Terminal window
forkpress branch record-plugin-validator-conflicts --run <id> (--findings-file <path>|--findings-json <json>) [--format text|json]
OptionRequiredDescription
--run <id>YesMerge run id.
--findings-file <path>One of findings file or JSONFile containing validator findings JSON. Preferred for real validators.
--findings-json <json>One of findings file or JSONInline JSON findings. Best for small fixtures.
--format text|jsonNoOutput format. Defaults to text.

run-plugin-driver

Terminal window
forkpress branch run-plugin-driver conflict <id> --driver <path> [--note <text>] [--reviewer <name>] [--format text|json]
forkpress branch run-plugin-driver conflict-key <key> [--run <id>] --driver <path> [--note <text>] [--reviewer <name>] [--format text|json]
OptionRequiredDescription
--driver <path>YesPlugin merge driver executable or script.
--run <id>Only for conflict-keyDisambiguate a logical conflict key.
--note <text>NoResolution note.
--reviewer <name>NoReviewer name.
--format text|jsonNoOutput format. Defaults to text.

The driver must emit JSON with status validated or applied and a result value.

record-plugin-driver-resolution

Terminal window
forkpress branch record-plugin-driver-resolution conflict <id> --driver <name> (--result-file <path>|--result-json <json>) [--previous-file <path>|--previous-json <json>] [--applied] [--note <text>] [--reviewer <name>] [--format text|json]
forkpress branch record-plugin-driver-resolution conflict-key <key> [--run <id>] --driver <name> (--result-file <path>|--result-json <json>) [--previous-file <path>|--previous-json <json>] [--applied] [--note <text>] [--reviewer <name>] [--format text|json]
OptionRequiredDescription
--driver <name>YesDriver name to record in audit metadata.
--run <id>Only for conflict-keyDisambiguate a logical conflict key.
--result-file <path>One of result file or JSONFile containing driver result JSON.
--result-json <json>One of result file or JSONInline driver result JSON.
--previous-file <path>NoFile containing previous plugin state JSON. Cannot be combined with --previous-json.
--previous-json <json>NoInline previous plugin state JSON. Cannot be combined with --previous-file.
--appliedNoMark the driver result as applied.
--note <text>NoResolution note.
--reviewer <name>NoReviewer name.
--format text|jsonNoOutput format. Defaults to text.

Examples

Create and preview a feature branch:

Terminal window
forkpress branch create marketing --from main

Merge a branch into main:

Terminal window
forkpress branch merge marketing --into main

Review and apply one conflict:

Terminal window
forkpress branch conflicts --run 42
forkpress branch merge-review conflict 7 --status reviewed --note "Reviewed metadata"
forkpress branch merge-resolve conflict 7 --choice source --apply

Run a plugin validator for a conflicted merge:

Terminal window
forkpress branch run-plugin-validator --run 42 --validator ./validator.php --format json

See Branching for the conceptual model, Merging for merge behavior, Conflict Review for review queues, and Plugin Validator Recipes for plugin-specific conflict checks.