'\" t .\" Title: git-show .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 03/19/2016 .\" Manual: Git Manual .\" Source: Git 1.7.10.4 .\" Language: English .\" .TH "GIT\-SHOW" "1" "03/19/2016" "Git 1\&.7\&.10\&.4" "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 [options] \&... .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 The command takes options applicable to the \fIgit diff\-tree\fR command 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\&. For a more complete list of ways to spell object names, see "SPECIFYING REVISIONS" section in \fBgitrevisions\fR(7)\&. .RE .PP \-\-pretty[=], \-\-format= .RS 4 Pretty\-print the contents of the commit logs in a given format, where \fI\fR can be one of \fIoneline\fR, \fIshort\fR, \fImedium\fR, \fIfull\fR, \fIfuller\fR, \fIemail\fR, \fIraw\fR and \fIformat:\fR\&. See the "PRETTY FORMATS" section for some additional details for each format\&. When omitted, the format defaults to \fImedium\fR\&. .sp Note: you can specify the default pretty format in the repository configuration (see \fBgit-config\fR(1))\&. .RE .PP \-\-abbrev\-commit .RS 4 Instead of showing the full 40\-byte hexadecimal commit object name, show only a partial prefix\&. Non default number of digits can be specified with "\-\-abbrev=" (which also modifies diff output, if it is displayed)\&. .sp This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&. .RE .PP \-\-no\-abbrev\-commit .RS 4 Show the full 40\-byte hexadecimal commit object name\&. This negates \-\-abbrev\-commit and those options which imply it such as "\-\-oneline"\&. It also overrides the \fIlog\&.abbrevCommit\fR variable\&. .RE .PP \-\-oneline .RS 4 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&. .RE .PP \-\-encoding[=] .RS 4 The commit objects record the 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\&. .RE .PP \-\-notes[=] .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 git log, git show and git whatchanged commands when there is no \-\-pretty, \-\-format nor \-\-oneline option given on the command line\&. .sp By default, the notes shown are from the notes refs listed in the \fIcore\&.notesRef\fR and \fInotes\&.displayRef\fR variables (or corresponding environment overrides)\&. See \fBgit-config\fR(1) for more details\&. .sp With an optional \fI\fR argument, show this notes ref instead of the default notes ref(s)\&. The ref is taken to be in refs/notes/ if it is not qualified\&. .sp Multiple \-\-notes options can be combined to control which notes are being displayed\&. Examples: "\-\-notes=foo" will show only notes from "refs/notes/foo"; "\-\-notes=foo \-\-notes" will show both notes from "refs/notes/foo" and from the default notes ref(s)\&. .RE .PP \-\-no\-notes .RS 4 Do not show notes\&. This negates the above \-\-notes 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\&. "\-\-notes \-\-notes=foo \-\-no\-notes \-\-notes=bar" will only show notes from "refs/notes/bar"\&. .RE .PP \-\-show\-notes[=], \-\-[no\-]standard\-notes .RS 4 These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&. .RE .SH "PRETTY FORMATS" .sp If the commit is a merge, and if the pretty\-format is not \fIoneline\fR, \fIemail\fR or \fIraw\fR, an additional line is inserted before the \fIAuthor:\fR line\&. This line begins with "Merge: " and the sha1s of ancestral commits are printed, separated by spaces\&. Note that the listed commits may not necessarily be the list of the \fBdirect\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 \fIformat:\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 .\} \fIoneline\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 .\} \fIshort\fR .sp .if n \{\ .RS 4 .\} .nf commit <sha1> Author: <author> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <title line> .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fImedium\fR .sp .if n \{\ .RS 4 .\} .nf commit <sha1> Author: <author> Date: <author date> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <title line> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <full commit message> .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIfull\fR .sp .if n \{\ .RS 4 .\} .nf commit <sha1> Author: <author> Commit: <committer> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <title line> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <full commit message> .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIfuller\fR .sp .if n \{\ .RS 4 .\} .nf commit <sha1> Author: <author> AuthorDate: <author date> Commit: <committer> CommitDate: <committer date> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <title line> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <full commit message> .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIemail\fR .sp .if n \{\ .RS 4 .\} .nf From <sha1> <date> From: <author> Date: <author date> Subject: [PATCH] <title line> .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf <full commit message> .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIraw\fR .sp The \fIraw\fR format shows the entire commit exactly as stored in the commit object\&. Notably, the SHA1s are displayed in full, regardless of whether \-\-abbrev or \-\-no\-abbrev are used, and \fIparents\fR information show the true parent commits, without taking grafts nor history simplification into account\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fIformat:<string>\fR .sp The \fIformat:<string>\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 \fI%n\fR instead of \fI\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<n> 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 .\} \fI%H\fR: commit hash .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%h\fR: abbreviated commit hash .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%T\fR: tree hash .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%t\fR: abbreviated tree hash .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%P\fR: parent hashes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%p\fR: abbreviated parent hashes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%an\fR: author name .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%aN\fR: author name (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ae\fR: author email .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%aE\fR: author email (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ad\fR: author date (format respects \-\-date= option) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%aD\fR: author date, RFC2822 style .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ar\fR: author date, relative .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%at\fR: author date, UNIX timestamp .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ai\fR: author date, ISO 8601 format .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%cn\fR: committer name .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%cN\fR: committer name (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ce\fR: committer email .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%cE\fR: committer email (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%cd\fR: committer date .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%cD\fR: committer date, RFC2822 style .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%cr\fR: committer date, relative .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ct\fR: committer date, UNIX timestamp .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ci\fR: committer date, ISO 8601 format .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%d\fR: ref names, like the \-\-decorate option of \fBgit-log\fR(1) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%e\fR: encoding .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%s\fR: subject .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%f\fR: sanitized subject line, suitable for a filename .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%b\fR: body .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%B\fR: raw body (unwrapped subject and body) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%N\fR: commit notes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%gD\fR: reflog selector, e\&.g\&., refs/stash@{1} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%gd\fR: shortened reflog selector, e\&.g\&., stash@{1} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%gn\fR: reflog identity name .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%gN\fR: reflog identity name (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%ge\fR: reflog identity email .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%gE\fR: reflog identity email (respecting \&.mailmap, see \fBgit-shortlog\fR(1) or \fBgit-blame\fR(1)) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%gs\fR: reflog subject .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%Cred\fR: switch color to red .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%Cgreen\fR: switch color to green .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%Cblue\fR: switch color to blue .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%Creset\fR: reset color .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%C(\&...)\fR: color specification, as described in color\&.branch\&.* config option .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%m\fR: left, right or boundary mark .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%n\fR: newline .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%%\fR: a raw \fI%\fR .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%x00\fR: print a byte from a hex code .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fI%w([<w>[,<i1>[,<i2>]]])\fR: switch line wrapping, like the \-w option of \fBgit-shortlog\fR(1)\&. .RE .RE .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 .sp Some placeholders may depend on other options given to the revision traversal engine\&. For example, the %g* reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by git log \-g)\&. The %d placeholder will use the "short" decoration format if \-\-decorate was not already provided on the command line\&. .sp .5v .RE .sp If you add a + (plus sign) after \fI%\fR of a placeholder, a line\-feed is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&. .sp If you add a \- (minus sign) after \fI%\fR of a placeholder, line\-feeds that immediately precede the expansion are deleted if and only if the placeholder expands to an empty string\&. .sp If you add a ` ` (space) after \fI%\fR of a placeholder, a space is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \fItformat:\fR .sp The \fItformat:\fR format works exactly like \fIformat:\fR, except that it provides "terminator" semantics instead of "separator" semantics\&. In other words, each commit has the message terminator character (usually a newline) appended, rather than a separator placed between entries\&. This means that the final entry of a single\-line format will be properly terminated with a new line, just as the "oneline" format does\&. For example: .sp .if n \{\ .RS 4 .\} .nf $ git log \-2 \-\-pretty=format:%h 4da45bef \e | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq 4da45be 7134973 \-\- NO NEWLINE $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq 4da45be 7134973 .fi .if n \{\ .RE .\} .sp In addition, any unrecognized string that has a % in it is interpreted as if it has tformat: in front of it\&. For example, these two are equivalent: .sp .if n \{\ .RS 4 .\} .nf $ git log \-2 \-\-pretty=tformat:%h 4da45bef $ git log \-2 \-\-pretty=%h 4da45bef .fi .if n \{\ .RE .\} .sp .RE .SH "EXAMPLES" .PP git show v1\&.0\&.0 .RS 4 Shows the tag v1\&.0\&.0, along with the object the tags points at\&. .RE .PP git show v1\&.0\&.0^{tree} .RS 4 Shows the tree pointed to by the tag v1\&.0\&.0\&. .RE .PP git show \-s \-\-format=%s v1\&.0\&.0^{commit} .RS 4 Shows the subject of the commit pointed to by the tag v1\&.0\&.0\&. .RE .PP git show next~10:Documentation/README .RS 4 Shows the contents of the file Documentation/README as they were current in the 10th last commit of the branch next\&. .RE .PP git show master:Makefile master:t/Makefile .RS 4 Concatenates the contents of said Makefiles in the head of the branch master\&. .RE .SH "DISCUSSION" .sp At the core level, git is character encoding agnostic\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The pathnames recorded in the index and in the tree objects are treated as uninterpreted sequences of non\-NUL bytes\&. What readdir(2) returns are what are recorded and compared with the data git keeps track of, which in turn are expected to be what lstat(2) and creat(2) accepts\&. There is no such thing as pathname encoding translation\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The contents of the blob objects are uninterpreted sequences of bytes\&. There is no encoding translation at the core level\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The commit log messages are uninterpreted sequences of non\-NUL bytes\&. .RE .sp Although we encourage that the commit log messages are encoded in UTF\-8, both the core and git Porcelain are designed not to force UTF\-8 on projects\&. If all participants of a particular project find it more convenient to use legacy encodings, git does not forbid it\&. However, there are a few things to keep in mind\&. .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} \fIgit commit\fR and \fIgit commit\-tree\fR issues a warning if the commit log message given to it does not look like a valid UTF\-8 string, unless you explicitly say your project uses a legacy encoding\&. The way to say this is to have i18n\&.commitencoding in \&.git/config file, like this: .sp .if n \{\ .RS 4 .\} .nf [i18n] commitencoding = ISO\-8859\-1 .fi .if n \{\ .RE .\} .sp Commit objects created with the above setting record the value of i18n\&.commitencoding in its encoding header\&. This is to help other people who look at them later\&. Lack of this header implies that the commit log message is encoded in UTF\-8\&. .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} \fIgit log\fR, \fIgit show\fR, \fIgit blame\fR and friends look at the encoding header of a commit object, and try to re\-code the log message into UTF\-8 unless otherwise specified\&. You can specify the desired output encoding with i18n\&.logoutputencoding in \&.git/config file, like this: .sp .if n \{\ .RS 4 .\} .nf [i18n] logoutputencoding = ISO\-8859\-1 .fi .if n \{\ .RE .\} .sp If you do not have this configuration variable, the value of i18n\&.commitencoding is used instead\&. .RE .sp Note that we deliberately chose not to re\-code the commit log message when a commit is made to force UTF\-8 at the commit object level, because re\-coding to UTF\-8 is not necessarily a reversible operation\&. .SH "GIT" .sp Part of the \fBgit\fR(1) suite