LinuxCommandLibrary

git-show

TLDR

Show last commit

$ git show
copy
Show specific commit
$ git show [commit-hash]
copy
Show tag
$ git show [v1.0.0]
copy
Show file at commit
$ git show [commit]:[file.txt]
copy
Show only stats
$ git show --stat
copy

SYNOPSIS

git show [options] object

DESCRIPTION

git show displays git objects. For commits, it shows the commit message and diff. For tags, it shows tag information. For trees and blobs, it shows contents.
The command is versatile for inspecting any git object. It combines log and diff functionality for convenient commit inspection.
git show provides object inspection for commits, tags, and files.

PARAMETERS

OBJECT

Commit, tag, or tree to show.
--stat
Show diffstat only.
--name-only
Show changed file names.
--name-status
Show names and status.
--format FORMAT
Output format.
-p, --patch
Show diff (default for commits).
--help
Display help information.

CAVEATS

Output varies by object type. Large diffs may need paging. Binary files show as binary.

HISTORY

git show is a core Git command for displaying objects, providing a unified interface to inspect various git object types.

SEE ALSO

Copied to clipboard