Git Show π
2026-06-23 | π Git
# git show Command
[Git Basic Operations](#)
* * *
The `git show` command is used to display detailed information about Git objects.
The `git show` command is used to view the content of commits, tags, tree objects, or other Git objects. This command is very useful for reviewing commit history, viewing specific commit content, and debugging Git objects.
### Basic Syntax
git show [] []
* **``**: Specifies the Git object to display. It can be a commit hash, tag, branch name, etc.
* **``**: Display options or format settings.
**Common Options and Usage:**
| **Option** | **Description** | **Usage Example** |
| --- | --- | --- |
| `--pretty=format:` | Customize output format. Use a format string to display commit information. | `git show --pretty=format:"%h %s" ` |
| `--name-only` | Only display the names of changed files. | `git show --name-only ` |
| `--name-status` | Display the names of changed files and their status (added, modified, deleted). | `git show --name-status ` |
| `--stat` | Display commit statistics, including changed files, line counts, and file changes. | `git show --stat ` |
| `--patch` | Display the diff patch of the commit (default behavior). | `git show --patch ` |
| `--color` | Display colored output for better readability. | `git show --color ` |
| `--no-patch` | Do not display the patch, only show commit information. | `git show --no-patch ` |
| `--abbrev-commit` | Display shortened commit hash. | `git show --abbrev-commit ` |
| `--pretty=oneline` | Display commit information in one-line format. | `git show --pretty=oneline ` |
### Common Usage
**1γDisplay Detailed Commit Information**
Display detailed commit information including commit message, author, date, and changed files:
git show
Example:
git show 9a0d7b6
**2γDisplay Commit Diff**
Only display the diff (patch) contained in the commit:
git show --patch
**Example:**
git show --patch 9a0d7b6
**3γDisplay Commit File List**
Only display the names of files changed in the commit:
git show --name-only
Example:
git show --name-only 9a0d7b6
**4γDisplay Commit Statistics**
Display commit statistics including changed files and line counts:
git show --stat
Example:
git show --stat 9a0d7b6
**5γDisplay Commit Information with Custom Format**
Use --pretty=