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 diff-index

Command reference for `libra diff-index`

Show the differences between a tree and the working tree — a plumbing entry point that reuses the one diff engine (see diff).

Synopsis

libra diff-index <tree> [-- <path>...]

Description

diff-index <tree> is equivalent to libra diff --old <tree>: it diffs the given tree-ish against the current working tree. Path limiters go after --, and all diff global flags apply.

--cached (compare the tree against the index) is not yet supported; use libra diff --staged for HEAD vs the index.

Options

OptionDescriptionExample
<tree>The tree-ish to compare against the working tree.libra diff-index HEAD
--cached / --cachedCompare against the index (not yet supported → exit 128).
-- <path>...Limit the diff to paths.libra diff-index HEAD -- src/
--json / --machineStructured diff output.libra --json diff-index HEAD

Exit codes

CodeMeaning
0No differences.
1There are differences (the diff is printed) — Git plumbing exit convention.
128The tree could not be resolved, --cached was given (unsupported), or not inside a repository.

Examples

# What has changed in the working tree relative to HEAD's tree?
libra diff-index HEAD

# HEAD vs the index (use diff --staged for now)
libra diff --staged

Comparison with Git

TaskLibraGit
Tree vs working treelibra diff-index <tree>git diff-index <tree>
Tree vs indexlibra diff --staged (HEAD only)git diff-index --cached <tree>

Deferred: --cached against an arbitrary tree, --stat-only raw output, and -m. Use libra diff for richer options.

libra diff-files

Command reference for `libra diff-files`

libra diff-tree

Command reference for `libra diff-tree`

On this page

SynopsisDescriptionOptionsExit codesExamplesComparison with Git