'\" t .\" Title: git-show .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 2025-11-17 .\" Manual: Git Manual .\" Source: Git 2.52.0 .\" Language: English .\" .TH "GIT\-SHOW" "1" "2025\-11\-17" "Git 2\&.52\&.0" "Git Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" git-show \- Show various types of objects .SH "SYNOPSIS" .sp .nf \fIgit show\fR [] [\&...] .fi .sp .SH "DESCRIPTION" .sp Shows one or more objects (blobs, trees, tags and commits)\&. .sp For commits it shows the log message and textual diff\&. It also presents the merge commit in a special format as produced by \fIgit diff\-tree \-\-cc\fR\&. .sp For tags, it shows the tag message and the referenced objects\&. .sp For trees, it shows the names (equivalent to \fIgit ls\-tree\fR with \-\-name\-only)\&. .sp For plain blobs, it shows the plain contents\&. .sp Some options that \fIgit log\fR command understands can be used to control how the changes the commit introduces are shown\&. .sp This manual page describes only the most frequently used options\&. .SH "OPTIONS" .PP \&... .RS 4 The names of objects to show (defaults to \fIHEAD\fR)\&. For a more complete list of ways to spell object names, see "SPECIFYING REVISIONS" section in \fBgitrevisions\fR(7)\&. .RE .PP \fB\-\-pretty\fR[\fB=\fR\fI\fR], \fB\-\-format=\fR\fI\fR .RS 4 Pretty\-print the contents of the commit logs in a given format, where \fI\fR can be one of \fBoneline\fR, \fBshort\fR, \fBmedium\fR, \fBfull\fR, \fBfuller\fR, \fBreference\fR, \fBemail\fR, \fBraw\fR, \fBformat:\fR\fI\fR and \fBtformat:\fR\fI\fR\&. When \fI\fR is none of the above, and has \fB%\fR\fI\fR in it, it acts as if \fB\-\-pretty=tformat:\fR\fI\fR were given\&. .sp See the "PRETTY FORMATS" section for some additional details for each format\&. When \fB=\fR\fI\fR part is omitted, it defaults to \fBmedium\fR\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br you can specify the default pretty format in the repository configuration (see \fBgit-config\fR(1))\&. .sp .5v .RE .RE .PP \fB\-\-abbrev\-commit\fR .RS 4 Instead of showing the full 40\-byte hexadecimal commit object name, show a prefix that names the object uniquely\&. \fB\-\-abbrev=\fR\fI\fR (which also modifies diff output, if it is displayed) option can be used to specify the minimum length of the prefix\&. .sp This should make \fB\-\-pretty=oneline\fR a whole lot more readable for people using 80\-column terminals\&. .RE .PP \fB\-\-no\-abbrev\-commit\fR .RS 4 Show the full 40\-byte hexadecimal commit object name\&. This negates \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as \fB\-\-oneline\fR\&. It also overrides the \fBlog\&.abbrevCommit\fR variable\&. .RE .PP \fB\-\-oneline\fR .RS 4 This is a shorthand for \fB\-\-pretty=oneline\fR \fB\-\-abbrev\-commit\fR used together\&. .RE .PP \fB\-\-encoding=\fR\fI\fR .RS 4 Commit objects record the character encoding used for the log message in their encoding header; this option can be used to tell the command to re\-code the commit log message in the encoding preferred by the user\&. For non plumbing commands this defaults to UTF\-8\&. Note that if an object claims to be encoded in \fBX\fR and we are outputting in \fBX\fR, we will output the object verbatim; this means that invalid sequences in the original commit may be copied to the output\&. Likewise, if iconv(3) fails to convert the commit, we will quietly output the original object verbatim\&. .RE .PP \fB\-\-expand\-tabs=\fR\fI\fR, \fB\-\-expand\-tabs\fR, \fB\-\-no\-expand\-tabs\fR .RS 4 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of \fI\fR) in the log message before showing it in the output\&. \fB\-\-expand\-tabs\fR is a short\-hand for \fB\-\-expand\-tabs=8\fR, and \fB\-\-no\-expand\-tabs\fR is a short\-hand for \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&. .sp By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&. \fBmedium\fR, which is the default, \fBfull\fR, and \fBfuller\fR)\&. .RE .PP \fB\-\-notes\fR[\fB=\fR\fI\fR] .RS 4 Show the notes (see \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for \fBgit\fR \fBlog\fR, \fBgit\fR \fBshow\fR and \fBgit\fR \fBwhatchanged\fR commands when there is no \fB\-\-pretty\fR, \fB\-\-format\fR, or \fB\-\-oneline\fR option given on the command line\&. .sp By default, the notes shown are from the notes refs listed in the \fBcore\&.notesRef\fR and \fBnotes\&.displayRef\fR variables (or corresponding environment overrides)\&. See \fBgit-config\fR(1) for more details\&. .sp With an optional \fI\fR argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with \fBrefs/notes/\fR; when it begins with \fBnotes/\fR, \fBrefs/\fR and otherwise \fBrefs/notes/\fR is prefixed to form the full name of the ref\&. .sp Multiple \fB\-\-notes\fR options can be combined to control which notes are being displayed\&. Examples: "\fB\-\-notes=foo\fR" will show only notes from \fBrefs/notes/foo\fR; "\fB\-\-notes=foo\fR \fB\-\-notes\fR" will show both notes from "refs/notes/foo" and from the default notes ref(s)\&. .RE .PP \fB\-\-no\-notes\fR .RS 4 Do not show notes\&. This negates the above \fB\-\-notes\fR option, by resetting the list of notes refs from which notes are shown\&. Options are parsed in the order given on the command line, so e\&.g\&. "\fB\-\-notes\fR \fB\-\-notes=foo\fR \fB\-\-no\-notes\fR \fB\-\-notes=bar\fR" will only show notes from \fBrefs/notes/bar\fR\&. .RE .PP \fB\-\-show\-notes\-by\-default\fR .RS 4 Show the default notes unless options for displaying specific notes are given\&. .RE .PP \fB\-\-show\-notes\fR[\fB=\fR\fI\fR], \fB\-\-standard\-notes\fR, \fB\-\-no\-standard\-notes\fR .RS 4 These options are deprecated\&. Use the above \fB\-\-notes\fR/\fB\-\-no\-notes\fR options instead\&. .RE .PP \fB\-\-show\-signature\fR .RS 4 Check the validity of a signed commit object by passing the signature to \fBgpg\fR \fB\-\-verify\fR and show the output\&. .RE .SH "PRETTY FORMATS" .sp If the commit is a merge, and if the pretty\-format is not \fBoneline\fR, \fBemail\fR or \fBraw\fR, an additional line is inserted before the \fBAuthor:\fR line\&. This line begins with "Merge: " and the hashes of ancestral commits are printed, separated by spaces\&. Note that the listed commits may not necessarily be the list of the \fIdirect\fR parent commits if you have limited your view of history: for example, if you are only interested in changes related to a certain directory or file\&. .sp There are several built\-in formats, and you can define additional formats by setting a pretty\&. config option to either another format name, or a \fBformat:\fR string, as described below (see \fBgit-config\fR(1))\&. Here are the details of the built\-in formats: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBoneline\fR .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .sp This is designed to be as compact as possible\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBshort\fR .sp .if n \{\ .RS 4 .\} .nf commit Author: .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBmedium\fR .sp .if n \{\ .RS 4 .\} .nf commit Author: Date: .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBfull\fR .sp .if n \{\ .RS 4 .\} .nf commit Author: Commit: .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBfuller\fR .sp .if n \{\ .RS 4 .\} .nf commit Author: AuthorDate: Commit: CommitDate: .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBreference\fR .sp .if n \{\ .RS 4 .\} .nf (, ) .fi .if n \{\ .RE .\} .sp This format is used to refer to another commit in a commit message and is the same as \fB\-\-pretty=\*(Aqformat:%C(auto)%h (%s, %ad)\*(Aq\fR\&. By default, the date is formatted with \fB\-\-date=short\fR unless another \fB\-\-date\fR option is explicitly specified\&. As with any \fBformat:\fR with format placeholders, its output is not affected by other options like \fB\-\-decorate\fR and \fB\-\-walk\-reflogs\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBemail\fR .sp .if n \{\ .RS 4 .\} .nf From From: Date: Subject: [PATCH] .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBmboxrd\fR .sp Like \fBemail\fR, but lines in the commit message starting with "From " (preceded by zero or more ">") are quoted with ">" so they aren\(cqt confused as starting a new commit\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBraw\fR .sp The \fBraw\fR format shows the entire commit exactly as stored in the commit object\&. Notably, the hashes are displayed in full, regardless of whether \fB\-\-abbrev\fR or \fB\-\-no\-abbrev\fR are used, and \fIparents\fR information show the true parent commits, without taking grafts or history simplification into account\&. Note that this format affects the way commits are displayed, but not the way the diff is shown e\&.g\&. with \fBgit\fR \fBlog\fR \fB\-\-raw\fR\&. To get full object names in a raw diff format, use \fB\-\-no\-abbrev\fR\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fBformat:\fR\fI\fR .sp The \fBformat:\fR\fI\fR format allows you to specify which information you want to show\&. It works a little bit like printf format, with the notable exception that you get a newline with \fB%n\fR instead of \fB\en\fR\&. .sp E\&.g, \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR would show something like this: .sp .if n \{\ .RS 4 .\} .nf The author of fe6e0ee was Junio C Hamano, 23 hours ago The title was >>t4119: test autocomputing \-p for traditional diff input\&.<< .fi .if n \{\ .RE .\} .sp The placeholders are: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Placeholders that expand to a single literal character: .PP \fB%n\fR .RS 4 newline .RE .PP \fB%%\fR .RS 4 a raw \fB%\fR .RE .PP \fB%x00\fR .RS 4 \fB%x\fR followed by two hexadecimal digits is replaced with a byte with the hexadecimal digits\*(Aq value (we will call this "literal formatting code" in the rest of this document)\&. .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Placeholders that affect formatting of later placeholders: .PP \fB%Cred\fR .RS 4 switch color to red .RE .PP \fB%Cgreen\fR .RS 4 switch color to green .RE .PP \fB%Cblue\fR .RS 4 switch color to blue .RE .PP \fB%Creset\fR .RS 4 reset color .RE .PP \fB%C(\fR\fI\fR\fB)\fR .RS 4 color specification, as described under Values in the "CONFIGURATION FILE" section of \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by \fBcolor\&.diff\fR, \fBcolor\&.ui\fR, or \fB\-\-color\fR, and respecting the \fBauto\fR settings of the former if we are going to a terminal)\&. \fB%C(auto,\fR\fI\fR\fB)\fR is accepted as a historical synonym for the default (e\&.g\&., \fB%C(auto,red)\fR)\&. Specifying \fB%C(always,\fR\fI\fR\fB)\fR will show the colors even when color is not otherwise enabled (though consider just using \fB\-\-color=always\fR to enable color for the whole output, including this format and anything else git might color)\&. \fBauto\fR alone (i\&.e\&. \fB%C(auto)\fR) will turn on auto coloring on the next placeholders until the color is switched again\&. .RE .PP \fB%m\fR .RS 4 left (<), right (>) or boundary (\fB\-\fR) mark .RE .PP \fB%w(\fR[\fI\fR[\fB,\fR\fI\fR[\fB,\fR\fI\fR]]]\fB)\fR .RS 4 switch line wrapping, like the \fB\-w\fR option of \fBgit-shortlog\fR(1)\&. .RE .PP \fB%<(\fR\fI\fR[\fB,\fR(\fBtrunc\fR|\fBltrunc\fR|\fBmtrunc\fR)]\fB)\fR .RS 4 make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis \&.\&.) at the left (ltrunc) \fB\&.\&.\fR\fBft\fR, the middle (mtrunc) \fBmi\fR\fB\&.\&.\fR\fBle\fR, or the end (trunc) \fBrig\&.\fR\&., if the output is longer than \fI\fR columns\&. Note 1: that truncating only works correctly with \fI\fR >= 2\&. Note 2: spaces around the \fI\fR and \fI\fR (see below) values are optional\&. Note 3: Emojis and other wide characters will take two display columns, which may over\-run column boundaries\&. Note 4: decomposed character combining marks may be misplaced at padding boundaries\&. .RE .PP \fB%<|(\fR\fI\fR \fB)\fR .RS 4 make the next placeholder take at least until \fI\fR th display column, padding spaces on the right if necessary\&. Use negative \fI\fR values for column positions measured from the right hand edge of the terminal window\&. .RE .PP \fB%>(\fR\fI\fR\fB)\fR, \fB%>|(\fR\fI\fR\fB)\fR .RS 4 similar to \fB%<(\fR\fI\fR\fB)\fR, \fB%<|(\fR\fI\fR\fB)\fR respectively, but padding spaces on the left .RE .PP \fB%>>(\fR\fI\fR\fB)\fR, \fB%>>|(\fR\fI\fR\fB)\fR .RS 4 similar to \fB%>(\fR\fI\fR\fB)\fR, \fB%>|(\fR\fI\fR\fB)\fR respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces .RE .PP \fB%><(\fR\fI\fR\fB)\fR, \fB%><|(\fR\fI\fR\fB)\fR .RS 4 similar to \fB%<(\fR\fI\fR\fB)\fR, \fB%<|(\fR\fI\fR\fB)\fR respectively, but padding both sides (i\&.e\&. the text is centered) .RE .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Placeholders that expand to information extracted from the commit: .PP \fB%H\fR .RS 4 commit hash .RE .PP \fB%h\fR .RS 4 abbreviated commit hash .RE .PP \fB%T\fR .RS 4 tree hash .RE .PP \fB%t\fR .RS 4 abbreviated tree hash .RE .PP \fB%P\fR .RS 4 parent hashes .RE .PP \fB%p\fR .RS 4 abbreviated parent hashes .RE .PP \fB%an\fR .RS 4 author name .RE .PP \fB%aN\fR .RS 4 author name (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .PP \fB%ae\fR .RS 4 author email .RE .PP \fB%aE\fR .RS 4 author email (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .PP \fB%al\fR .RS 4 author email local\-part (the part before the \fB@\fR sign) .RE .PP \fB%aL\fR .RS 4 author local\-part (see \fB%al\fR) respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .PP \fB%ad\fR .RS 4 author date (format respects \-\-date= option) .RE .PP \fB%aD\fR .RS 4 author date, RFC2822 style .RE .PP \fB%ar\fR .RS 4 author date, relative .RE .PP \fB%at\fR .RS 4 author date, UNIX timestamp .RE .PP \fB%ai\fR .RS 4 author date, ISO 8601\-like format .RE .PP \fB%aI\fR .RS 4 author date, strict ISO 8601 format .RE .PP \fB%as\fR .RS 4 author date, short format (\fBYYYY\-MM\-DD\fR) .RE .PP \fB%ah\fR .RS 4 author date, human style (like the \fB\-\-date=human\fR option of \fBgit-rev-list\fR(1)) .RE .PP \fB%cn\fR .RS 4 committer name .RE .PP \fB%cN\fR .RS 4 committer name (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .PP \fB%ce\fR .RS 4 committer email .RE .PP \fB%cE\fR .RS 4 committer email (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .PP \fB%cl\fR .RS 4 committer email local\-part (the part before the \fB@\fR sign) .RE .PP \fB%cL\fR .RS 4 committer local\-part (see \fB%cl\fR) respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .PP \fB%cd\fR .RS 4 committer date (format respects \-\-date= option) .RE .PP \fB%cD\fR .RS 4 committer date, RFC2822 style .RE .PP \fB%cr\fR .RS 4 committer date, relative .RE .PP \fB%ct\fR .RS 4 committer date, UNIX timestamp .RE .PP \fB%ci\fR .RS 4 committer date, ISO 8601\-like format .RE .PP \fB%cI\fR .RS 4 committer date, strict ISO 8601 format .RE .PP \fB%cs\fR .RS 4 committer date, short format (\fBYYYY\-MM\-DD\fR) .RE .PP \fB%ch\fR .RS 4 committer date, human style (like the \fB\-\-date=human\fR option of \fBgit-rev-list\fR(1)) .RE .PP \fB%d\fR .RS 4 ref names, like the \-\-decorate option of \fBgit-log\fR(1) .RE .PP \fB%D\fR .RS 4 ref names without the " (", ")" wrapping\&. .RE .PP \fB%(decorate\fR[\fB:\fR\fI