Skip to content
Latchkey

git show: Usage, Options & Common CI Errors

git show prints one object - usually a commit and its diff - in detail.

Use git show to inspect a single commit, see a file at a past revision, or read a tag message.

What it does

git show displays the metadata and contents of an object. For a commit it shows the log message and the diff; for a tag, the tag message; for a blob, its contents.

Common usage

Terminal
git show <sha>
git show HEAD --stat
git show HEAD:path/to/file        # file contents at HEAD
git show v1.2.0                   # tag + its commit
git show --name-only <sha>

Options

FlagWhat it does
--statShow a diffstat instead of the full diff
--name-onlyList changed files only
-s / --no-patchSuppress the diff (metadata only)
<rev>:<path>Show a file as of a revision

Common errors in CI

fatal: bad revision 'X' or fatal: ambiguous argument 'X': unknown revision - the SHA/ref does not exist (often truncated, or absent in a shallow clone). Verify the ref with git rev-parse, and remember <rev>:<path> needs an exact in-repo path.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →