LibraLibra
LibraLibra
DocsBlogLibra
Getting Started
Architecture
Design
Commands
libra addlibra agentlibra alternateslibra applylibra archivelibra authlibra automationlibra bisectlibra blamelibra branchlibra bundlelibra cachelibra cat-filelibra check-attrlibra check-ignorelibra check-mailmaplibra checkoutlibra cherry-picklibra cleanlibra clonelibra cloudlibra code-controllibra codelibra commit-treelibra commitlibra completionslibra configlibra credentiallibra depslibra describelibra diff-fileslibra diff-indexlibra diff-treelibra difflibra dirtylibra fast-exportlibra fast-importlibra fetchlibra filelibra for-each-reflibra format-patchlibra fscklibra gclibra graphlibra greplibra hash-objectlibra hookslibra hydratelibra index-packlibra initlibra investigatelibra layerlibra lfslibra loglibra logfilelibra loginlibra logoutlibra ls-fileslibra ls-remotelibra ls-treelibra maintenancelibra medialibra merge-baselibra merge-filelibra mergelibra metadatalibra mvlibra noteslibra oplibra openlibra pack-objectslibra packagelibra prunelibra publishlibra pulllibra pushlibra read-treelibra rebaselibra refloglibra remotelibra repacklibra replacelibra rererelibra resetlibra restorelibra rev-listlibra rev-parselibra revertlibra reviewlibra revisionlibra rmlibra sandboxlibra servicelibra shortloglibra show-reflibra showlibra sparse-viewlibra stashlibra statslibra statuslibra switchlibra symbolic-reflibra taglibra update-indexlibra update-reflibra usagelibra verify-packlibra whoamilibra worktreelibra write-tree
API Reference
Policy
Commands

libra rerere

Command reference for `libra rerere`

REuse REcorded REsolution. Records how you resolved a merge conflict and replays that resolution automatically when the identical conflict reappears.

Synopsis

libra rerere [status | diff | forget <path>... | clear | gc]

Description

With no subcommand, rerere scans the tracked files for conflict markers and:

  • records a preimage (the conflicted file) for each new conflict, tracking it in .libra/rerere/MERGE_RR;
  • if a recorded postimage (resolution) already matches a conflict, replays it — writing the resolved content back to the file;
  • once a tracked conflict has been resolved by hand, records its postimage so the next identical conflict resolves itself.

A conflict is matched by the SHA-256 of the conflicted file's bytes, so a resolution replays when the whole conflicted file is byte-identical to one seen before.

SubcommandDescription
(none)Record preimages / replay resolutions / record postimages.
statusList the paths whose conflicts are currently tracked.
diffShow what changed in each tracked file since its preimage was recorded.
forget <path>...Drop the recorded resolution for the given paths.
clearStop tracking the current conflicts (recorded resolutions are kept).
gcPrune recorded resolutions older than the thresholds (60 days resolved / 15 days unresolved).

Exit codes

CodeMeaning
0Success.
128Not inside a repository, forget of a path with no recording, or an I/O error.

Examples

# After a merge leaves conflicts, record them
libra rerere

# Resolve the files by hand, then let rerere learn the resolution
libra rerere

# The next time the same conflict appears, rerere resolves it for you
libra rerere status

Comparison with Git

TaskLibraGit
Record / replaylibra rereregit rerere
Inspectlibra rerere status / diffgit rerere status / diff
Drop / resetlibra rerere forget <p> / clear / gcgit rerere forget <p> / clear / gc

Automatic integration

When rerere.enabled is true, merge, rebase, and cherry-pick run rerere for you — there is no need to invoke libra rerere by hand:

  • when a conflict is written, the preimage is recorded and, if the identical conflict was resolved before, the resolution is replayed into the working tree;
  • when the conflict is resolved and the operation is committed / --continued, the postimage (your resolution) is recorded.

Enable it with:

libra config rerere.enabled true

With rerere.enabled unset (the default) these hooks are complete no-ops, so those commands behave exactly as before.

Staging of a replayed file follows rerere.autoUpdate (libra config rerere.autoUpdate true). cherry-pick --rerere-autoupdate turns the same staging on for a single invocation; merge and rebase do not expose the positive flag, so they rely on rerere.autoUpdate.

Differences and deferred features: matching is whole-file byte-identical (Git normalises each conflict hunk and is independent of ours/theirs order).

libra replace

Command reference for `libra replace`

libra reset

Command reference for `libra reset`

On this page

SynopsisDescriptionExit codesExamplesComparison with GitAutomatic integration