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 symbolic-ref

Command reference for `libra symbolic-ref`

Read or update Libra's symbolic HEAD reference.

Synopsis

libra symbolic-ref [--short] [--quiet] [HEAD]
libra symbolic-ref HEAD refs/heads/<branch>

Description

libra symbolic-ref is a Git-compatible plumbing command for inspecting or changing the symbolic ref stored in HEAD. Libra currently supports the local HEAD symbolic ref. Other symbolic refs are rejected because Libra stores refs in SQLite rather than loose files under .git/.

When HEAD points at a branch, the read form prints refs/heads/<branch>. When HEAD is detached, the command exits with an invalid-target error. With --quiet, Libra suppresses the user-facing hint but still reports failure through the normal structured error contract.

The update form is silent in human output when it succeeds.

Options

OptionDescription
--shortPrint only the branch name, for example main
-q, --quietSuppress extra guidance when HEAD is not symbolic
HEADThe symbolic ref to inspect or update. Omitted defaults to HEAD
refs/heads/<branch>New symbolic target for HEAD

Examples

libra symbolic-ref HEAD
libra symbolic-ref --short HEAD
libra symbolic-ref HEAD refs/heads/main
libra --json symbolic-ref HEAD

Structured Output

{
  "ok": true,
  "command": "symbolic-ref",
  "data": {
    "name": "HEAD",
    "target": "refs/heads/main",
    "short": "main",
    "action": "read"
  }
}

For updates, action is set.

Compatibility Notes

  • Libra supports HEAD only.
  • Update targets must be local branch refs under refs/heads/.
  • The command can point HEAD at an unborn branch, matching Git's ability to store a symbolic branch target before the branch has a commit.

libra switch

Command reference for `libra switch`

libra tag

Command reference for `libra tag`

On this page

SynopsisDescriptionOptionsExamplesStructured OutputCompatibility Notes