1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.5.2" />
7 <title>git-show(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.0em;
131 div
.content
{ /* Block element content. */
135 /* Block element titles. */
136 div
.title
, caption
.title
{
138 font-family: sans-serif
;
142 margin-bottom: 0.5em;
148 td div
.title:first-child
{
151 div
.content div
.title:first-child
{
154 div
.content
+ div
.title
{
158 div
.sidebarblock
> div
.content
{
160 border: 1px solid silver
;
164 div
.listingblock
> div
.content
{
165 border: 1px solid silver
;
170 div
.quoteblock
, div
.verseblock
{
174 border-left: 5px solid
#dddddd;
178 div
.quoteblock
> div
.attribution
{
183 div
.verseblock
> div
.content
{
186 div
.verseblock
> div
.attribution
{
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div
.verseblock
+ div
.attribution
{
195 div
.admonitionblock
.icon
{
199 text-decoration: underline
;
201 padding-right: 0.5em;
203 div
.admonitionblock td
.content
{
205 border-left: 3px solid
#dddddd;
208 div
.exampleblock
> div
.content
{
209 border-left: 3px solid
#dddddd;
213 div
.imageblock div
.content
{ padding-left: 0; }
214 span
.image img
{ border-style: none
; }
215 a
.image:visited
{ color: white
; }
219 margin-bottom: 0.8em;
232 list-style-position: outside
;
235 list-style-type: decimal
;
238 list-style-type: lower-alpha
;
241 list-style-type: upper-alpha
;
244 list-style-type: lower-roman
;
247 list-style-type: upper-roman
;
250 div
.compact ul
, div
.compact ol
,
251 div
.compact p
, div
.compact p
,
252 div
.compact div
, div
.compact div
{
254 margin-bottom: 0.1em;
257 div
.tableblock
> table
{
258 border: 3px solid
#527bbd;
260 thead
, p
.table
.header
{
261 font-family: sans-serif
;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div
.tableblock
> table
[frame
="void"] {
277 div
.tableblock
> table
[frame
="hsides"] {
278 border-left-style: none
;
279 border-right-style: none
;
281 div
.tableblock
> table
[frame
="vsides"] {
282 border-top-style: none
;
283 border-bottom-style: none
;
289 margin-bottom: 0.8em;
292 padding-bottom: 15px;
294 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
300 padding-right: 0.8em;
306 div
.hdlist
.compact tr
{
315 .footnote, .footnoteref {
319 span
.footnote
, span
.footnoteref
{
320 vertical-align: super
;
324 margin: 20px 0 20px 0;
328 #footnotes div
.footnote
{
334 border-top: 1px solid silver
;
344 div#footer-badges
{ display: none
; }
348 margin-bottom: 2.5em;
353 font-family: sans-serif
;
357 margin-bottom: 0.1em;
360 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
376 /* Overrides for manpage documents */
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver
;
381 border-bottom: 2px solid silver
;
391 div#toc
{ display: none
; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div
.sidebar-content
{
398 border: 1px solid silver
;
401 div
.sidebar-title
, div
.image-title
{
403 font-family: sans-serif
;
406 margin-bottom: 0.5em;
409 div
.listingblock div
.content
{
410 border: 1px solid silver
;
415 div
.quoteblock-attribution
{
420 div
.verseblock-content
{
423 div
.verseblock-attribution
{
428 div
.exampleblock-content
{
429 border-left: 3px solid
#dddddd;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc
a:visited
{ color: blue
; }
436 <script type=
"text/javascript">
438 window
.onload = function(){asciidoc
.footnotes();}
439 var asciidoc
= { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
459 toc: function (toclevels
) {
461 function getText(el
) {
463 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
464 if (i
.nodeType
== 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
466 else if (i
.firstChild
!= null)
472 function TocEntry(el
, text
, toclevel
) {
475 this.toclevel
= toclevel
;
478 function tocEntries(el
, toclevels
) {
479 var result
= new Array
;
480 var re
= new RegExp('[hH]([2-'+(toclevels
+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
484 var iterate = function (el
) {
485 for (var i
= el
.firstChild
; i
!= null; i
= i
.nextSibling
) {
486 if (i
.nodeType
== 1 /* Node.ELEMENT_NODE */) {
487 var mo
= re
.exec(i
.tagName
);
488 if (mo
&& (i
.getAttribute("class") || i
.getAttribute("className")) != "float") {
489 result
[result
.length
] = new TocEntry(i
, getText(i
), mo
[1]-1);
499 var toc
= document
.getElementById("toc");
500 var entries
= tocEntries(document
.getElementById("content"), toclevels
);
501 for (var i
= 0; i
< entries
.length
; ++i
) {
502 var entry
= entries
[i
];
503 if (entry
.element
.id
== "")
504 entry
.element
.id
= "_toc_" + i
;
505 var a
= document
.createElement("a");
506 a
.href
= "#" + entry
.element
.id
;
507 a
.appendChild(document
.createTextNode(entry
.text
));
508 var div
= document
.createElement("div");
510 div
.className
= "toclevel" + entry
.toclevel
;
511 toc
.appendChild(div
);
513 if (entries
.length
== 0)
514 toc
.parentNode
.removeChild(toc
);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont
= document
.getElementById("content");
528 var noteholder
= document
.getElementById("footnotes");
529 var spans
= cont
.getElementsByTagName("span");
532 for (i
=0; i
<spans
.length
; i
++) {
533 if (spans
[i
].className
== "footnote") {
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note
= spans
[i
].innerHTML
.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder
.innerHTML
+=
539 "<div class='footnote' id='_footnote_" + n
+ "'>" +
540 "<a href='#_footnoteref_" + n
+ "' title='Return to text'>" +
541 n
+ "</a>. " + note
+ "</div>";
543 "[<a id='_footnoteref_" + n
+ "' href='#_footnote_" + n
+
544 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
545 var id
=spans
[i
].getAttribute("id");
546 if (id
!= null) refs
["#"+id
] = n
;
550 noteholder
.parentNode
.removeChild(noteholder
);
552 // Process footnoterefs.
553 for (i
=0; i
<spans
.length
; i
++) {
554 if (spans
[i
].className
== "footnoteref") {
555 var href
= spans
[i
].getElementsByTagName("a")[0].getAttribute("href");
556 href
= href
.match(/#.*/)[0]; // Because IE return full URL.
559 "[<a href='#_footnote_" + n
+
560 "' title='View footnote' class='footnote'>" + n
+ "</a>]";
573 git-show(
1) Manual Page
576 <div class=
"sectionbody">
578 Show various types of objects
583 <h2 id=
"_synopsis">SYNOPSIS
</h2>
584 <div class=
"sectionbody">
585 <div class=
"verseblock">
586 <div class=
"verseblock-content"><em>git show
</em> [options]
<object
>…</div>
587 <div class=
"verseblock-attribution">
590 <h2 id=
"_description">DESCRIPTION
</h2>
591 <div class=
"sectionbody">
592 <div class=
"paragraph"><p>Shows one or more objects (blobs, trees, tags and commits).
</p></div>
593 <div class=
"paragraph"><p>For commits it shows the log message and textual diff. It also
594 presents the merge commit in a special format as produced by
595 <em>git diff-tree --cc
</em>.
</p></div>
596 <div class=
"paragraph"><p>For tags, it shows the tag message and the referenced objects.
</p></div>
597 <div class=
"paragraph"><p>For trees, it shows the names (equivalent to
<em>git ls-tree
</em>
598 with --name-only).
</p></div>
599 <div class=
"paragraph"><p>For plain blobs, it shows the plain contents.
</p></div>
600 <div class=
"paragraph"><p>The command takes options applicable to the
<em>git diff-tree
</em> command to
601 control how the changes the commit introduces are shown.
</p></div>
602 <div class=
"paragraph"><p>This manual page describes only the most frequently used options.
</p></div>
604 <h2 id=
"_options">OPTIONS
</h2>
605 <div class=
"sectionbody">
606 <div class=
"dlist"><dl>
608 <object
>…
612 The names of objects to show.
613 For a more complete list of ways to spell object names, see
614 "SPECIFYING REVISIONS" section in
<a href=
"gitrevisions.html">gitrevisions(
7)
</a>.
618 --pretty[=
<format
>]
621 --format=
<format
>
625 Pretty-print the contents of the commit logs in a given format,
626 where
<em><format
></em> can be one of
<em>oneline
</em>,
<em>short
</em>,
<em>medium
</em>,
627 <em>full
</em>,
<em>fuller
</em>,
<em>email
</em>,
<em>raw
</em> and
<em>format:
<string
></em>. See
628 the
"PRETTY FORMATS" section for some additional details for each
629 format. When omitted, the format defaults to
<em>medium
</em>.
631 <div class=
"paragraph"><p>Note: you can specify the default pretty format in the repository
632 configuration (see
<a href=
"git-config.html">git-config(
1)
</a>).
</p></div>
639 Instead of showing the full
40-byte hexadecimal commit object
640 name, show only a partial prefix. Non default number of
641 digits can be specified with
"--abbrev=<n>" (which also modifies
642 diff output, if it is displayed).
644 <div class=
"paragraph"><p>This should make
"--pretty=oneline" a whole lot more readable for
645 people using
80-column terminals.
</p></div>
652 Show the full
40-byte hexadecimal commit object name. This negates
653 <tt>--abbrev-commit
</tt> and those options which imply it such as
654 "--oneline". It also overrides the
<em>log.abbrevCommit
</em> variable.
662 This is a shorthand for
"--pretty=oneline --abbrev-commit"
667 --encoding[=
<encoding
>]
671 The commit objects record the encoding used for the log message
672 in their encoding header; this option can be used to tell the
673 command to re-code the commit log message in the encoding
674 preferred by the user. For non plumbing commands this
679 --notes[=
<ref
>]
683 Show the notes (see
<a href=
"git-notes.html">git-notes(
1)
</a>) that annotate the
684 commit, when showing the commit log message. This is the default
685 for
<tt>git log
</tt>,
<tt>git show
</tt> and
<tt>git whatchanged
</tt> commands when
686 there is no
<tt>--pretty
</tt>,
<tt>--format
</tt> nor
<tt>--oneline
</tt> option given
689 <div class=
"paragraph"><p>By default, the notes shown are from the notes refs listed in the
690 <em>core.notesRef
</em> and
<em>notes.displayRef
</em> variables (or corresponding
691 environment overrides). See
<a href=
"git-config.html">git-config(
1)
</a> for more details.
</p></div>
692 <div class=
"paragraph"><p>With an optional
<em><ref
></em> argument, show this notes ref instead of the
693 default notes ref(s). The ref is taken to be in
<tt>refs/notes/
</tt> if it
694 is not qualified.
</p></div>
695 <div class=
"paragraph"><p>Multiple --notes options can be combined to control which notes are
696 being displayed. Examples:
"--notes=foo" will show only notes from
697 "refs/notes/foo";
"--notes=foo --notes" will show both notes from
698 "refs/notes/foo" and from the default notes ref(s).
</p></div>
705 Do not show notes. This negates the above
<tt>--notes
</tt> option, by
706 resetting the list of notes refs from which notes are shown.
707 Options are parsed in the order given on the command line, so e.g.
708 "--notes --notes=foo --no-notes --notes=bar" will only show notes
709 from
"refs/notes/bar".
713 --show-notes[=
<ref
>]
716 --[no-]standard-notes
720 These options are deprecated. Use the above --notes/--no-notes
726 <h2 id=
"_pretty_formats">PRETTY FORMATS
</h2>
727 <div class=
"sectionbody">
728 <div class=
"paragraph"><p>If the commit is a merge, and if the pretty-format
729 is not
<em>oneline
</em>,
<em>email
</em> or
<em>raw
</em>, an additional line is
730 inserted before the
<em>Author:
</em> line. This line begins with
731 "Merge: " and the sha1s of ancestral commits are printed,
732 separated by spaces. Note that the listed commits may not
733 necessarily be the list of the
<strong>direct
</strong> parent commits if you
734 have limited your view of history: for example, if you are
735 only interested in changes related to a certain directory or
737 <div class=
"paragraph"><p>There are several built-in formats, and you can define
738 additional formats by setting a pretty.
<name
>
739 config option to either another format name, or a
740 <em>format:
</em> string, as described below (see
741 <a href=
"git-config.html">git-config(
1)
</a>). Here are the details of the
742 built-in formats:
</p></div>
743 <div class=
"ulist"><ul>
748 <div class=
"literalblock">
749 <div class=
"content">
750 <pre><tt><sha1
> <title line
></tt></pre>
752 <div class=
"paragraph"><p>This is designed to be as compact as possible.
</p></div>
758 <div class=
"literalblock">
759 <div class=
"content">
760 <pre><tt>commit
<sha1
>
761 Author:
<author
></tt></pre>
763 <div class=
"literalblock">
764 <div class=
"content">
765 <pre><tt><title line
></tt></pre>
772 <div class=
"literalblock">
773 <div class=
"content">
774 <pre><tt>commit
<sha1
>
775 Author:
<author
>
776 Date:
<author date
></tt></pre>
778 <div class=
"literalblock">
779 <div class=
"content">
780 <pre><tt><title line
></tt></pre>
782 <div class=
"literalblock">
783 <div class=
"content">
784 <pre><tt><full commit message
></tt></pre>
791 <div class=
"literalblock">
792 <div class=
"content">
793 <pre><tt>commit
<sha1
>
794 Author:
<author
>
795 Commit:
<committer
></tt></pre>
797 <div class=
"literalblock">
798 <div class=
"content">
799 <pre><tt><title line
></tt></pre>
801 <div class=
"literalblock">
802 <div class=
"content">
803 <pre><tt><full commit message
></tt></pre>
810 <div class=
"literalblock">
811 <div class=
"content">
812 <pre><tt>commit
<sha1
>
813 Author:
<author
>
814 AuthorDate:
<author date
>
815 Commit:
<committer
>
816 CommitDate:
<committer date
></tt></pre>
818 <div class=
"literalblock">
819 <div class=
"content">
820 <pre><tt><title line
></tt></pre>
822 <div class=
"literalblock">
823 <div class=
"content">
824 <pre><tt><full commit message
></tt></pre>
831 <div class=
"literalblock">
832 <div class=
"content">
833 <pre><tt>From
<sha1
> <date
>
835 Date:
<author date
>
836 Subject: [PATCH]
<title line
></tt></pre>
838 <div class=
"literalblock">
839 <div class=
"content">
840 <pre><tt><full commit message
></tt></pre>
847 <div class=
"paragraph"><p>The
<em>raw
</em> format shows the entire commit exactly as
848 stored in the commit object. Notably, the SHA1s are
849 displayed in full, regardless of whether --abbrev or
850 --no-abbrev are used, and
<em>parents
</em> information show the
851 true parent commits, without taking grafts nor history
852 simplification into account.
</p></div>
856 <em>format:
<string
></em>
858 <div class=
"paragraph"><p>The
<em>format:
<string
></em> format allows you to specify which information
859 you want to show. It works a little bit like printf format,
860 with the notable exception that you get a newline with
<em>%n
</em>
861 instead of
<em>\n
</em>.
</p></div>
862 <div class=
"paragraph"><p>E.g,
<em>format:
"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em>
863 would show something like this:
</p></div>
864 <div class=
"listingblock">
865 <div class=
"content">
866 <pre><tt>The author of fe6e0ee was Junio C Hamano,
23 hours ago
867 The title was
>>t4119: test autocomputing -p
<n
> for traditional diff input.
<<</tt></pre>
869 <div class=
"paragraph"><p>The placeholders are:
</p></div>
870 <div class=
"ulist"><ul>
873 <em>%H
</em>: commit hash
878 <em>%h
</em>: abbreviated commit hash
883 <em>%T
</em>: tree hash
888 <em>%t
</em>: abbreviated tree hash
893 <em>%P
</em>: parent hashes
898 <em>%p
</em>: abbreviated parent hashes
903 <em>%an
</em>: author name
908 <em>%aN
</em>: author name (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
913 <em>%ae
</em>: author email
918 <em>%aE
</em>: author email (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
923 <em>%ad
</em>: author date (format respects --date= option)
928 <em>%aD
</em>: author date, RFC2822 style
933 <em>%ar
</em>: author date, relative
938 <em>%at
</em>: author date, UNIX timestamp
943 <em>%ai
</em>: author date, ISO
8601 format
948 <em>%cn
</em>: committer name
953 <em>%cN
</em>: committer name (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
958 <em>%ce
</em>: committer email
963 <em>%cE
</em>: committer email (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
968 <em>%cd
</em>: committer date
973 <em>%cD
</em>: committer date, RFC2822 style
978 <em>%cr
</em>: committer date, relative
983 <em>%ct
</em>: committer date, UNIX timestamp
988 <em>%ci
</em>: committer date, ISO
8601 format
993 <em>%d
</em>: ref names, like the --decorate option of
<a href=
"git-log.html">git-log(
1)
</a>
998 <em>%e
</em>: encoding
1003 <em>%s
</em>: subject
1008 <em>%f
</em>: sanitized subject line, suitable for a filename
1018 <em>%B
</em>: raw body (unwrapped subject and body)
1023 <em>%N
</em>: commit notes
1028 <em>%gD
</em>: reflog selector, e.g.,
<tt>refs/stash@{
1}
</tt>
1033 <em>%gd
</em>: shortened reflog selector, e.g.,
<tt>stash@{
1}
</tt>
1038 <em>%gs
</em>: reflog subject
1043 <em>%Cred
</em>: switch color to red
1048 <em>%Cgreen
</em>: switch color to green
1053 <em>%Cblue
</em>: switch color to blue
1058 <em>%Creset
</em>: reset color
1063 <em>%C(
…)
</em>: color specification, as described in color.branch.* config option
1068 <em>%m
</em>: left, right or boundary mark
1073 <em>%n
</em>: newline
1078 <em>%%
</em>: a raw
<em>%
</em>
1083 <em>%x00
</em>: print a byte from a hex code
1088 <em>%w([
<w
>[,
<i1
>[,
<i2
>]]])
</em>: switch line wrapping, like the -w option of
1089 <a href=
"git-shortlog.html">git-shortlog(
1)
</a>.
1095 <div class=
"admonitionblock">
1098 <div class=
"title">Note
</div>
1100 <td class=
"content">Some placeholders may depend on other options given to the
1101 revision traversal engine. For example, the
<tt>%g*
</tt> reflog options will
1102 insert an empty string unless we are traversing reflog entries (e.g., by
1103 <tt>git log -g
</tt>). The
<tt>%d
</tt> placeholder will use the
"short" decoration
1104 format if
<tt>--decorate
</tt> was not already provided on the command line.
</td>
1107 <div class=
"paragraph"><p>If you add a
<tt>+</tt> (plus sign) after
<em>%
</em> of a placeholder, a line-feed
1108 is inserted immediately before the expansion if and only if the
1109 placeholder expands to a non-empty string.
</p></div>
1110 <div class=
"paragraph"><p>If you add a
<tt>-
</tt> (minus sign) after
<em>%
</em> of a placeholder, line-feeds that
1111 immediately precede the expansion are deleted if and only if the
1112 placeholder expands to an empty string.
</p></div>
1113 <div class=
"paragraph"><p>If you add a ` ` (space) after
<em>%
</em> of a placeholder, a space
1114 is inserted immediately before the expansion if and only if the
1115 placeholder expands to a non-empty string.
</p></div>
1116 <div class=
"ulist"><ul>
1121 <div class=
"paragraph"><p>The
<em>tformat:
</em> format works exactly like
<em>format:
</em>, except that it
1122 provides
"terminator" semantics instead of
"separator" semantics. In
1123 other words, each commit has the message terminator character (usually a
1124 newline) appended, rather than a separator placed between entries.
1125 This means that the final entry of a single-line format will be properly
1126 terminated with a new line, just as the
"oneline" format does.
1127 For example:
</p></div>
1128 <div class=
"listingblock">
1129 <div class=
"content">
1130 <pre><tt>$ git log -
2 --pretty=format:%h
4da45bef \
1131 | perl -pe '$_ .=
" -- NO NEWLINE\n" unless /\n/'
1133 7134973 -- NO NEWLINE
1135 $ git log -
2 --pretty=tformat:%h
4da45bef \
1136 | perl -pe '$_ .=
" -- NO NEWLINE\n" unless /\n/'
1140 <div class=
"paragraph"><p>In addition, any unrecognized string that has a
<tt>%
</tt> in it is interpreted
1141 as if it has
<tt>tformat:
</tt> in front of it. For example, these two are
1142 equivalent:
</p></div>
1143 <div class=
"listingblock">
1144 <div class=
"content">
1145 <pre><tt>$ git log -
2 --pretty=tformat:%h
4da45bef
1146 $ git log -
2 --pretty=%h
4da45bef
</tt></pre>
1151 <h2 id=
"_examples">EXAMPLES
</h2>
1152 <div class=
"sectionbody">
1153 <div class=
"dlist"><dl>
1154 <dt class=
"hdlist1">
1155 <tt>git show v1.0
.0</tt>
1159 Shows the tag
<tt>v1.0
.0</tt>, along with the object the tags
1163 <dt class=
"hdlist1">
1164 <tt>git show v1.0
.0^{tree}
</tt>
1168 Shows the tree pointed to by the tag
<tt>v1.0
.0</tt>.
1171 <dt class=
"hdlist1">
1172 <tt>git show -s --format=%s v1.0
.0^{commit}
</tt>
1176 Shows the subject of the commit pointed to by the
1177 tag
<tt>v1.0
.0</tt>.
1180 <dt class=
"hdlist1">
1181 <tt>git show next~
10:Documentation/README
</tt>
1185 Shows the contents of the file
<tt>Documentation/README
</tt> as
1186 they were current in the
10th last commit of the branch
1190 <dt class=
"hdlist1">
1191 <tt>git show master:Makefile master:t/Makefile
</tt>
1195 Concatenates the contents of said Makefiles in the head
1196 of the branch
<tt>master
</tt>.
1201 <h2 id=
"_discussion">Discussion
</h2>
1202 <div class=
"sectionbody">
1203 <div class=
"paragraph"><p>At the core level, git is character encoding agnostic.
</p></div>
1204 <div class=
"ulist"><ul>
1207 The pathnames recorded in the index and in the tree objects
1208 are treated as uninterpreted sequences of non-NUL bytes.
1209 What readdir(
2) returns are what are recorded and compared
1210 with the data git keeps track of, which in turn are expected
1211 to be what lstat(
2) and creat(
2) accepts. There is no such
1212 thing as pathname encoding translation.
1217 The contents of the blob objects are uninterpreted sequences
1218 of bytes. There is no encoding translation at the core
1224 The commit log messages are uninterpreted sequences of non-NUL
1229 <div class=
"paragraph"><p>Although we encourage that the commit log messages are encoded
1230 in UTF-
8, both the core and git Porcelain are designed not to
1231 force UTF-
8 on projects. If all participants of a particular
1232 project find it more convenient to use legacy encodings, git
1233 does not forbid it. However, there are a few things to keep in
1235 <div class=
"olist arabic"><ol class=
"arabic">
1238 <em>git commit
</em> and
<em>git commit-tree
</em> issues
1239 a warning if the commit log message given to it does not look
1240 like a valid UTF-
8 string, unless you explicitly say your
1241 project uses a legacy encoding. The way to say this is to
1242 have i18n.commitencoding in
<tt>.git/config
</tt> file, like this:
1244 <div class=
"listingblock">
1245 <div class=
"content">
1247 commitencoding = ISO-
8859-
1</tt></pre>
1249 <div class=
"paragraph"><p>Commit objects created with the above setting record the value
1250 of
<tt>i18n.commitencoding
</tt> in its
<tt>encoding
</tt> header. This is to
1251 help other people who look at them later. Lack of this header
1252 implies that the commit log message is encoded in UTF-
8.
</p></div>
1256 <em>git log
</em>,
<em>git show
</em>,
<em>git blame
</em> and friends look at the
1257 <tt>encoding
</tt> header of a commit object, and try to re-code the
1258 log message into UTF-
8 unless otherwise specified. You can
1259 specify the desired output encoding with
1260 <tt>i18n.logoutputencoding
</tt> in
<tt>.git/config
</tt> file, like this:
1262 <div class=
"listingblock">
1263 <div class=
"content">
1265 logoutputencoding = ISO-
8859-
1</tt></pre>
1267 <div class=
"paragraph"><p>If you do not have this configuration variable, the value of
1268 <tt>i18n.commitencoding
</tt> is used instead.
</p></div>
1271 <div class=
"paragraph"><p>Note that we deliberately chose not to re-code the commit log
1272 message when a commit is made to force UTF-
8 at the commit
1273 object level, because re-coding to UTF-
8 is not necessarily a
1274 reversible operation.
</p></div>
1276 <h2 id=
"_git">GIT
</h2>
1277 <div class=
"sectionbody">
1278 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1281 <div id=
"footnotes"><hr /></div>
1283 <div id=
"footer-text">
1284 Last updated
2011-
09-
21 23:
01:
14 PDT