gritHEAD → docs/show
Commands / HistoryMarkdown

grit show

Show a commit, tag or branch, and a summary of what it changed.

grit show [<object>]

Description

Shows a commit's id, author, date and full message, followed by a summary of the files it changed and how many lines were added and removed in each. With no argument, it shows the current commit.

<object> can be a commit id (full or short), an expression like HEAD~2, a branch or a tag. For a branch or tag, the first line names it. For an annotated tag, the tag's own author, date and message come before the commit it points at.

To see the full change a commit made, use grit diff <commit>.

Options

Option Description
<object> The commit, branch or tag to show. Defaults to the current commit.

JSON output

Pass --json for stable, scripting-friendly output:

Field Type Meaning
kind string commit, branch, tag, or annotated_tag.
ref_name string Branch or tag name when you named a ref; omitted for a raw commit id.
tag object For an annotated tag: name, tagger, and message.
commit object Commit id, parents, author, committer, subject, and full message.
stat object Change stats with files, files_changed, insertions, and deletions.

Markdown output