cli.sgit.ai / Command reference / sgit history

sgit history

Commit history and diffs.

Generated from sgit help all --format json, sgit-ai v0.23.0. 7 subcommands below. To change this page, change the command's register() in the CLI and regenerate.

sgit history

Subcommands

sgit history diff

Show file-level and content-level diff

sgit history diff [options] [range_spec] [directory]
ArgumentWhat it is
range_specoptionalCommit range (e.g. abc..def); synonym for --commit A --commit2 B
directoryoptionalVault directory (default: .)
OptionWhat it does
--commitCompare working copy vs specific commit
--commit2Second commit for commit-to-commit diff (requires --commit)
--files-onlyShow file names only (no inline diff)
--jsonStructured JSON output for agents
--remoteCompare working copy vs named branch HEAD

sgit history log

Show commit history

sgit history log [options] [range_spec] [directory]
ArgumentWhat it is
range_specoptionalCommit range (e.g. abc..def); omit for full history
directoryoptionalVault directory (default: .)
OptionWhat it does
--authorOnly commits by WHO: a branch name exactly (alice matches alice, not alice-laptop: use --author alice-laptop), or a signing key id / branch id, whole or by 4+ hex at either end (--author 3f9a)
--fileShow only commits that touched this file
--filesInclude files changed per commit (range mode)
--graphShow graph with connectors
--grepOnly commits whose message matches (case-insensitive regular expression)
--jsonStructured JSON output for agents (range mode)
--onelineCompact one-line-per-commit format
--patchInclude full diff per commit (range mode)
--sinceOnly commits at or after WHEN (2026-10-08, 2026-10-08T14:30, 3d, 12h, "2 weeks ago")
--statList the files each commit added (A), modified (M), deleted (D) or renamed (R)
--untilOnly commits before WHEN (same forms)
--vault-keyVault key (auto-read from .sg_vault/local/vault_key if omitted)
-n, --max-countLimit output to the last N commits

sgit history reflog

Where this clone's head has pointed (local, newest first)

sgit history reflog [options] [directory]
ArgumentWhat it is
directoryoptionalVault directory (default: .)
OptionWhat it does
--allEvery local ref, not just this clone's head
-n, --max-countShow the last N moves (default 20, 0 = all)

sgit history reset

Reset local branch HEAD to a specific commit (git reset --hard)

sgit history reset [commit_id] [directory]
ArgumentWhat it is
commit_idoptionalTarget commit ID (full or prefix); omit to discard working-copy changes
directoryoptionalVault directory (default: .)

sgit history revert

Restore working copy files to a past commit

sgit history revert [options] [directory] [files]
ArgumentWhat it is
directoryoptionalVault directory (default: .)
filesoptionalSpecific files to revert (default: all)
OptionWhat it does
--as-commitMake a NEW commit that inverts --commit (git revert); push it to undo a pushed change for everyone
--commitRevert to a specific commit (default: HEAD)
--forceSkip confirmation prompt when reverting all files
-m, --messageMessage for --as-commit (default: Revert "<original>")

sgit history show

Show changes introduced by a commit

sgit history show [options] <commit_id> [directory]
ArgumentWhat it is
commit_idrequiredCommit ID to inspect
directoryoptionalVault directory (default: .)
OptionWhat it does
--files-onlyShow file names only (no inline diff)

sgit history undo

Move this clone's head back to where it was before its last move (local)

sgit history undo [options] [directory]
ArgumentWhat it is
directoryoptionalVault directory (default: .)
OptionWhat it does
--forceUndo even when the head is already on the server (this clone only)

This page as markdown · its source, admin/content/reference/sgit-cli-reference.json