← 返回命令列表

Linux command

git-show 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show last commit

git show

Show specific commit

git show [commit-hash]

Show tag

git show [v1.0.0]

Show file at commit

git show [commit]:[file.txt]

Show only stats

git show --stat

说明

git show displays various types of Git objects. For commits, it shows the commit message and diff. For tags, it shows the tag annotation. For trees and blobs, it shows the contents directly. The command combines log and diff functionality into a convenient single-object inspector, making it the go-to tool for examining any Git object.

参数

--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.

FAQ

What is the git-show command used for?

git show displays various types of Git objects. For commits, it shows the commit message and diff. For tags, it shows the tag annotation. For trees and blobs, it shows the contents directly. The command combines log and diff functionality into a convenient single-object inspector, making it the go-to tool for examining any Git object.

How do I run a basic git-show example?

Run `git show` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --stat do in git-show?

Show diffstat only.