Git show

The git show command provides detailed information about a specific commit, such as changes made, the author, date, and commit message. It is useful for examining the content of a particular commit in more depth compared to the git log.



Tutorials dojo strip

Initial Example

git




SHOW Options

OptionDescription
--prettyCustomize the log output format. Possible values: oneline, short, full, fuller, etc.
--statShow statistics for files modified in the commit.
--patch, -pShow the full diff of the commit.
--name-onlyShow only the names of the files that were changed.
--name-statusShow the names and status of files that were changed.
--abbrev-commitShow only the first few characters of the SHA-1 hash.
--relative-dateShow dates relative to the current time (e.g., “2 weeks ago”).
--no-commit-idSuppress the commit ID in the output.
--sourceShow the source of the commit (branch/tag).
--full-diffShow the full diff, not just the patch.
--colorShow colored diff output.




Examples

1. Show Details of a Specific Commit

Displays detailed information about the specified commit.

git

Replace abc1234 with the actual commit hash you want to view.

2. Show Changes in a Specific File

Shows changes made to a specific file in the given commit.

git

Replace abc1234 with the commit hash and path/to/file with the file path.

3. Show Details with Patch

Displays detailed information along with the full patch (diff) of the specified commit.

git

Replace abc1234 with the actual commit hash.

4. Show Details of the Most Recent Commit

Displays detailed information about the latest commit on the current branch.

git
Tutorials dojo strip