Skip to main content
Chapter 37 of 61 · 1 sections · Page 142

Git: Show

Inspect commit details, patch diffs, tree objects, and blob contents using git show.

Original chapter reference: Chapter 37: Show. The command options and documentation recipes below are fully transcribed from Git Notes for Professionals.

Section 37.1: Overview

git show shows various Git objects.

For commits:

Shows the commit message and a diff of the changes introduced.

Command Description git show shows the previous commit git show @~3 shows the 3rd-from-last commit For trees and blobs:

Shows the tree or blob.

Command Description git show @~3: shows the project root directory as it was 3 commits ago (a tree) git show @~3:src/program.js shows src/program.js as it was 3 commits ago (a blob) git show @:a.txt @:b.txt shows a.txt concatenated with b.txt from current commit For tags:

Shows the tag message and the referenced object.

Buy me a coffee
Daily Practice
0/0