1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=UTF-8" />
7 <meta name=
"generator" content=
"AsciiDoc 10.2.0" />
8 <title>git-diff-tree(
1)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.5em;
129 margin-bottom:
1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
228 div.imageblock div.content { padding-left:
0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size:
2em; }
411 span.small { font-size:
0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
443 div.tableblock
> table[
frame=
"hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock
> table[
frame=
"vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
480 border-color: #
527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-top {
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September
2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
558 /* modified by Troy D. Hanson, September
2006. License: GPL */
559 /* modified by Stuart Rackham,
2006,
2009. License: GPL */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
578 this.toclevel = toclevel;
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([
1-'+(toclevels+
1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType ==
1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute(
"class") || i.getAttribute(
"className")) !=
"float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[
1]-
1);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
610 for (i =
0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute(
"class")
614 && entry.getAttribute(
"class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
617 for (i =
0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById(
"content"), toclevels);
623 for (var i =
0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id ==
"")
626 entry.element.id =
"_toc_" + i;
627 var a = document.createElement(
"a");
628 a.href =
"#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement(
"div");
632 div.className =
"toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length ==
0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/
2005/
07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
651 var noteholder = document.getElementById(
"footnotes");
655 var entriesToRemove = [];
656 for (i =
0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute(
"class") ==
"footnote")
659 entriesToRemove.push(entry);
661 for (i =
0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById(
"content");
667 var spans = cont.getElementsByTagName(
"span");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-note");
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[
1];
679 "[<a id='_footnoteref_" + n +
"' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n +
"</a>]";
681 spans[i].setAttribute(
"data-note", note);
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n +
"'>" +
685 "<a href='#_footnoteref_" + n +
"' title='Return to text'>" +
686 n +
"</a>. " + note +
"</div>";
687 var id =spans[i].getAttribute(
"id");
688 if (id != null) refs[
"#"+id] = n;
692 noteholder.parentNode.removeChild(noteholder);
694 // Process footnoterefs.
695 for (i=
0; i
<spans.length; i++) {
696 if (spans[i].className ==
"footnoteref") {
697 var href = spans[i].getElementsByTagName(
"a")[
0].getAttribute(
"href");
698 href = href.match(/#.*/)[
0]; // Because IE return full URL.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 git-diff-tree(
1) Manual Page
741 <div class=
"sectionbody">
743 Compares the content and mode of blobs found via two tree objects
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"verseblock">
752 <pre class=
"content"><em>git diff-tree
</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
753 [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]
754 [
<common-diff-options
>]
<tree-ish
> [
<tree-ish
>] [
<path
>…]
</pre>
755 <div class=
"attribution">
760 <h2 id=
"_description">DESCRIPTION
</h2>
761 <div class=
"sectionbody">
762 <div class=
"paragraph"><p>Compares the content and mode of the blobs found via two tree objects.
</p></div>
763 <div class=
"paragraph"><p>If there is only one
<tree-ish
> given, the commit is compared with its parents
764 (see --stdin below).
</p></div>
765 <div class=
"paragraph"><p>Note that
<em>git diff-tree
</em> can use the tree encapsulated in a commit object.
</p></div>
769 <h2 id=
"_options">OPTIONS
</h2>
770 <div class=
"sectionbody">
771 <div class=
"dlist"><dl>
783 Generate patch (see section titled
784 "Generating patch text with -p").
795 Suppress diff output. Useful for commands like
<code>git show
</code> that
796 show the patch by default, or to cancel the effect of
<code>--patch
</code>.
807 Generate diffs with
<n
> lines of context instead of
809 Implies
<code>--patch
</code>.
813 --output=
<file
>
817 Output to a specific file instead of stdout.
821 --output-indicator-new=
<char
>
824 --output-indicator-old=
<char
>
827 --output-indicator-context=
<char
>
831 Specify the character used to indicate new, old or context
832 lines in the generated patch. Normally they are
<em>+
</em>,
<em>-
</em> and
841 Generate the diff in raw format.
850 Synonym for
<code>-p --raw
</code>.
858 Enable the heuristic that shifts diff hunk boundaries to make patches
859 easier to read. This is the default.
863 --no-indent-heuristic
867 Disable the indent heuristic.
875 Spend extra time to make sure the smallest possible
884 Generate a diff using the
"patience diff" algorithm.
892 Generate a diff using the
"histogram diff" algorithm.
896 --anchored=
<text
>
900 Generate a diff using the
"anchored diff" algorithm.
902 <div class=
"paragraph"><p>This option may be specified more than once.
</p></div>
903 <div class=
"paragraph"><p>If a line exists in both the source and destination, exists only once,
904 and starts with this text, this algorithm attempts to prevent it from
905 appearing as a deletion or addition in the output. It uses the
"patience
906 diff" algorithm internally.
</p></div>
909 --diff-algorithm={patience|minimal|histogram|myers}
913 Choose a diff algorithm. The variants are as follows:
915 <div class=
"openblock">
916 <div class=
"content">
917 <div class=
"dlist"><dl>
919 <code>default
</code>,
<code>myers
</code>
923 The basic greedy diff algorithm. Currently, this is the default.
931 Spend extra time to make sure the smallest possible diff is
936 <code>patience
</code>
940 Use
"patience diff" algorithm when generating patches.
944 <code>histogram
</code>
948 This algorithm extends the patience algorithm to
"support
949 low-occurrence common elements".
954 <div class=
"paragraph"><p>For instance, if you configured the
<code>diff.algorithm
</code> variable to a
955 non-default value and want to use the default one, then you
956 have to use
<code>--diff-algorithm=default
</code> option.
</p></div>
959 --stat[=
<width
>[,
<name-width
>[,
<count
>]]]
963 Generate a diffstat. By default, as much space as necessary
964 will be used for the filename part, and the rest for the graph
965 part. Maximum width defaults to terminal width, or
80 columns
966 if not connected to a terminal, and can be overridden by
967 <code><width
></code>. The width of the filename part can be limited by
968 giving another width
<code><name-width
></code> after a comma. The width
969 of the graph part can be limited by using
970 <code>--stat-graph-width=
<width
></code> (affects all commands generating
971 a stat graph) or by setting
<code>diff.statGraphWidth=
<width
></code>
972 (does not affect
<code>git format-patch
</code>).
973 By giving a third parameter
<code><count
></code>, you can limit the
974 output to the first
<code><count
></code> lines, followed by
<code>...
</code> if
977 <div class=
"paragraph"><p>These parameters can also be set individually with
<code>--stat-width=
<width
></code>,
978 <code>--stat-name-width=
<name-width
></code> and
<code>--stat-count=
<count
></code>.
</p></div>
985 Output a condensed summary of extended header information such
986 as file creations or deletions (
"new" or
"gone", optionally
"+l"
987 if it
’s a symlink) and mode changes (
"+x" or
"-x" for adding
988 or removing executable bit respectively) in diffstat. The
989 information is put between the filename part and the graph
990 part. Implies
<code>--stat
</code>.
998 Similar to
<code>--stat
</code>, but shows number of added and
999 deleted lines in decimal notation and pathname without
1000 abbreviation, to make it more machine friendly. For
1001 binary files, outputs two
<code>-
</code> instead of saying
1005 <dt class=
"hdlist1">
1010 Output only the last line of the
<code>--stat
</code> format containing total
1011 number of modified files, as well as number of added and deleted
1015 <dt class=
"hdlist1">
1016 -X[
<param1,param2,
…>]
1018 <dt class=
"hdlist1">
1019 --dirstat[=
<param1,param2,
…>]
1023 Output the distribution of relative amount of changes for each
1024 sub-directory. The behavior of
<code>--dirstat
</code> can be customized by
1025 passing it a comma separated list of parameters.
1026 The defaults are controlled by the
<code>diff.dirstat
</code> configuration
1027 variable (see
<a href=
"git-config.html">git-config(
1)
</a>).
1028 The following parameters are available:
1030 <div class=
"openblock">
1031 <div class=
"content">
1032 <div class=
"dlist"><dl>
1033 <dt class=
"hdlist1">
1034 <code>changes
</code>
1038 Compute the dirstat numbers by counting the lines that have been
1039 removed from the source, or added to the destination. This ignores
1040 the amount of pure code movements within a file. In other words,
1041 rearranging lines in a file is not counted as much as other changes.
1042 This is the default behavior when no parameter is given.
1045 <dt class=
"hdlist1">
1050 Compute the dirstat numbers by doing the regular line-based diff
1051 analysis, and summing the removed/added line counts. (For binary
1052 files, count
64-byte chunks instead, since binary files have no
1053 natural concept of lines). This is a more expensive
<code>--dirstat
</code>
1054 behavior than the
<code>changes
</code> behavior, but it does count rearranged
1055 lines within a file as much as other changes. The resulting output
1056 is consistent with what you get from the other
<code>--*stat
</code> options.
1059 <dt class=
"hdlist1">
1064 Compute the dirstat numbers by counting the number of files changed.
1065 Each changed file counts equally in the dirstat analysis. This is
1066 the computationally cheapest
<code>--dirstat
</code> behavior, since it does
1067 not have to look at the file contents at all.
1070 <dt class=
"hdlist1">
1071 <code>cumulative
</code>
1075 Count changes in a child directory for the parent directory as well.
1076 Note that when using
<code>cumulative
</code>, the sum of the percentages
1077 reported may exceed
100%. The default (non-cumulative) behavior can
1078 be specified with the
<code>noncumulative
</code> parameter.
1081 <dt class=
"hdlist1">
1086 An integer parameter specifies a cut-off percent (
3% by default).
1087 Directories contributing less than this percentage of the changes
1088 are not shown in the output.
1093 <div class=
"paragraph"><p>Example: The following will count changed files, while ignoring
1094 directories with less than
10% of the total amount of changed files,
1095 and accumulating child directory counts in the parent directories:
1096 <code>--dirstat=files,
10,cumulative
</code>.
</p></div>
1098 <dt class=
"hdlist1">
1103 Synonym for --dirstat=cumulative
1106 <dt class=
"hdlist1">
1107 --dirstat-by-file[=
<param1,param2
>…]
1111 Synonym for --dirstat=files,param1,param2
…
1114 <dt class=
"hdlist1">
1119 Output a condensed summary of extended header information
1120 such as creations, renames and mode changes.
1123 <dt class=
"hdlist1">
1128 Synonym for
<code>-p --stat
</code>.
1131 <dt class=
"hdlist1">
1136 When
<code>--raw
</code>,
<code>--numstat
</code>,
<code>--name-only
</code> or
<code>--name-status
</code> has been
1137 given, do not munge pathnames and use NULs as output field terminators.
1139 <div class=
"paragraph"><p>Without this option, pathnames with
"unusual" characters are quoted as
1140 explained for the configuration variable
<code>core.quotePath
</code> (see
1141 <a href=
"git-config.html">git-config(
1)
</a>).
</p></div>
1143 <dt class=
"hdlist1">
1148 Show only names of changed files. The file names are often encoded in UTF-
8.
1149 For more information see the discussion about encoding in the
<a href=
"git-log.html">git-log(
1)
</a>
1153 <dt class=
"hdlist1">
1158 Show only names and status of changed files. See the description
1159 of the
<code>--diff-filter
</code> option on what the status letters mean.
1160 Just like
<code>--name-only
</code> the file names are often encoded in UTF-
8.
1163 <dt class=
"hdlist1">
1164 --submodule[=
<format
>]
1168 Specify how differences in submodules are shown. When specifying
1169 <code>--submodule=short
</code> the
<em>short
</em> format is used. This format just
1170 shows the names of the commits at the beginning and end of the range.
1171 When
<code>--submodule
</code> or
<code>--submodule=log
</code> is specified, the
<em>log
</em>
1172 format is used. This format lists the commits in the range like
1173 <a href=
"git-submodule.html">git-submodule(
1)
</a> <code>summary
</code> does. When
<code>--submodule=diff
</code>
1174 is specified, the
<em>diff
</em> format is used. This format shows an
1175 inline diff of the changes in the submodule contents between the
1176 commit range. Defaults to
<code>diff.submodule
</code> or the
<em>short
</em> format
1177 if the config option is unset.
1180 <dt class=
"hdlist1">
1181 --color[=
<when
>]
1186 <code>--color
</code> (i.e. without
<em>=
<when
></em>) is the same as
<code>--color=always
</code>.
1187 <em><when
></em> can be one of
<code>always
</code>,
<code>never
</code>, or
<code>auto
</code>.
1190 <dt class=
"hdlist1">
1195 Turn off colored diff.
1196 It is the same as
<code>--color=never
</code>.
1199 <dt class=
"hdlist1">
1200 --color-moved[=
<mode
>]
1204 Moved lines of code are colored differently.
1205 The
<mode
> defaults to
<em>no
</em> if the option is not given
1206 and to
<em>zebra
</em> if the option with no mode is given.
1207 The mode must be one of:
1209 <div class=
"openblock">
1210 <div class=
"content">
1211 <div class=
"dlist"><dl>
1212 <dt class=
"hdlist1">
1217 Moved lines are not highlighted.
1220 <dt class=
"hdlist1">
1225 Is a synonym for
<code>zebra
</code>. This may change to a more sensible mode
1229 <dt class=
"hdlist1">
1234 Any line that is added in one location and was removed
1235 in another location will be colored with
<em>color.diff.newMoved
</em>.
1236 Similarly
<em>color.diff.oldMoved
</em> will be used for removed lines
1237 that are added somewhere else in the diff. This mode picks up any
1238 moved line, but it is not very useful in a review to determine
1239 if a block of code was moved without permutation.
1242 <dt class=
"hdlist1">
1247 Blocks of moved text of at least
20 alphanumeric characters
1248 are detected greedily. The detected blocks are
1249 painted using either the
<em>color.diff.{old,new}Moved
</em> color.
1250 Adjacent blocks cannot be told apart.
1253 <dt class=
"hdlist1">
1258 Blocks of moved text are detected as in
<em>blocks
</em> mode. The blocks
1259 are painted using either the
<em>color.diff.{old,new}Moved
</em> color or
1260 <em>color.diff.{old,new}MovedAlternative
</em>. The change between
1261 the two colors indicates that a new block was detected.
1264 <dt class=
"hdlist1">
1269 Similar to
<em>zebra
</em>, but additional dimming of uninteresting parts
1270 of moved code is performed. The bordering lines of two adjacent
1271 blocks are considered interesting, the rest is uninteresting.
1272 <code>dimmed_zebra
</code> is a deprecated synonym.
1278 <dt class=
"hdlist1">
1283 Turn off move detection. This can be used to override configuration
1284 settings. It is the same as
<code>--color-moved=no
</code>.
1287 <dt class=
"hdlist1">
1288 --color-moved-ws=
<modes
>
1292 This configures how whitespace is ignored when performing the
1293 move detection for
<code>--color-moved
</code>.
1294 These modes can be given as a comma separated list:
1296 <div class=
"openblock">
1297 <div class=
"content">
1298 <div class=
"dlist"><dl>
1299 <dt class=
"hdlist1">
1304 Do not ignore whitespace when performing move detection.
1307 <dt class=
"hdlist1">
1312 Ignore changes in whitespace at EOL.
1315 <dt class=
"hdlist1">
1320 Ignore changes in amount of whitespace. This ignores whitespace
1321 at line end, and considers all other sequences of one or
1322 more whitespace characters to be equivalent.
1325 <dt class=
"hdlist1">
1330 Ignore whitespace when comparing lines. This ignores differences
1331 even if one line has whitespace where the other line has none.
1334 <dt class=
"hdlist1">
1335 allow-indentation-change
1339 Initially ignore any whitespace in the move detection, then
1340 group the moved code blocks only into a block if the change in
1341 whitespace is the same per line. This is incompatible with the
1348 <dt class=
"hdlist1">
1353 Do not ignore whitespace when performing move detection. This can be
1354 used to override configuration settings. It is the same as
1355 <code>--color-moved-ws=no
</code>.
1358 <dt class=
"hdlist1">
1359 --word-diff[=
<mode
>]
1363 Show a word diff, using the
<mode
> to delimit changed words.
1364 By default, words are delimited by whitespace; see
1365 <code>--word-diff-regex
</code> below. The
<mode
> defaults to
<em>plain
</em>, and
1368 <div class=
"openblock">
1369 <div class=
"content">
1370 <div class=
"dlist"><dl>
1371 <dt class=
"hdlist1">
1376 Highlight changed words using only colors. Implies
<code>--color
</code>.
1379 <dt class=
"hdlist1">
1384 Show words as
<code>[-removed-]
</code> and
<code>{+added+}
</code>. Makes no
1385 attempts to escape the delimiters if they appear in the input,
1386 so the output may be ambiguous.
1389 <dt class=
"hdlist1">
1394 Use a special line-based format intended for script
1395 consumption. Added/removed/unchanged runs are printed in the
1396 usual unified diff format, starting with a
<code>+
</code>/
<code>-
</code>/` `
1397 character at the beginning of the line and extending to the
1398 end of the line. Newlines in the input are represented by a
1399 tilde
<code>~
</code> on a line of its own.
1402 <dt class=
"hdlist1">
1407 Disable word diff again.
1412 <div class=
"paragraph"><p>Note that despite the name of the first mode, color is used to
1413 highlight the changed parts in all modes if enabled.
</p></div>
1415 <dt class=
"hdlist1">
1416 --word-diff-regex=
<regex
>
1420 Use
<regex
> to decide what a word is, instead of considering
1421 runs of non-whitespace to be a word. Also implies
1422 <code>--word-diff
</code> unless it was already enabled.
1424 <div class=
"paragraph"><p>Every non-overlapping match of the
1425 <regex
> is considered a word. Anything between these matches is
1426 considered whitespace and ignored(!) for the purposes of finding
1427 differences. You may want to append
<code>|[^[:space:]]
</code> to your regular
1428 expression to make sure that it matches all non-whitespace characters.
1429 A match that contains a newline is silently truncated(!) at the
1431 <div class=
"paragraph"><p>For example,
<code>--word-diff-regex=.
</code> will treat each character as a word
1432 and, correspondingly, show differences character by character.
</p></div>
1433 <div class=
"paragraph"><p>The regex can also be set via a diff driver or configuration option, see
1434 <a href=
"gitattributes.html">gitattributes(
5)
</a> or
<a href=
"git-config.html">git-config(
1)
</a>. Giving it explicitly
1435 overrides any diff driver or configuration setting. Diff drivers
1436 override configuration settings.
</p></div>
1438 <dt class=
"hdlist1">
1439 --color-words[=
<regex
>]
1443 Equivalent to
<code>--word-diff=color
</code> plus (if a regex was
1444 specified)
<code>--word-diff-regex=
<regex
></code>.
1447 <dt class=
"hdlist1">
1452 Turn off rename detection, even when the configuration
1453 file gives the default to do so.
1456 <dt class=
"hdlist1">
1461 Whether to use empty blobs as rename source.
1464 <dt class=
"hdlist1">
1469 Warn if changes introduce conflict markers or whitespace errors.
1470 What are considered whitespace errors is controlled by
<code>core.whitespace
</code>
1471 configuration. By default, trailing whitespaces (including
1472 lines that consist solely of whitespaces) and a space character
1473 that is immediately followed by a tab character inside the
1474 initial indent of the line are considered whitespace errors.
1475 Exits with non-zero status if problems are found. Not compatible
1479 <dt class=
"hdlist1">
1480 --ws-error-highlight=
<kind
>
1484 Highlight whitespace errors in the
<code>context
</code>,
<code>old
</code> or
<code>new
</code>
1485 lines of the diff. Multiple values are separated by comma,
1486 <code>none
</code> resets previous values,
<code>default
</code> reset the list to
1487 <code>new
</code> and
<code>all
</code> is a shorthand for
<code>old,new,context
</code>. When
1488 this option is not given, and the configuration variable
1489 <code>diff.wsErrorHighlight
</code> is not set, only whitespace errors in
1490 <code>new
</code> lines are highlighted. The whitespace errors are colored
1491 with
<code>color.diff.whitespace
</code>.
1494 <dt class=
"hdlist1">
1499 Instead of the first handful of characters, show the full
1500 pre- and post-image blob object names on the
"index"
1501 line when generating patch format output.
1504 <dt class=
"hdlist1">
1509 In addition to
<code>--full-index
</code>, output a binary diff that
1510 can be applied with
<code>git-apply
</code>.
1511 Implies
<code>--patch
</code>.
1514 <dt class=
"hdlist1">
1515 --abbrev[=
<n
>]
1519 Instead of showing the full
40-byte hexadecimal object
1520 name in diff-raw format output and diff-tree header
1521 lines, show the shortest prefix that is at least
<em><n
></em>
1522 hexdigits long that uniquely refers the object.
1523 In diff-patch output format,
<code>--full-index
</code> takes higher
1524 precedence, i.e. if
<code>--full-index
</code> is specified, full blob
1525 names will be shown regardless of
<code>--abbrev
</code>.
1526 Non default number of digits can be specified with
<code>--abbrev=
<n
></code>.
1529 <dt class=
"hdlist1">
1530 -B[
<n
>][/
<m
>]
1532 <dt class=
"hdlist1">
1533 --break-rewrites[=[
<n
>][/
<m
>]]
1537 Break complete rewrite changes into pairs of delete and
1538 create. This serves two purposes:
1540 <div class=
"paragraph"><p>It affects the way a change that amounts to a total rewrite of a file
1541 not as a series of deletion and insertion mixed together with a very
1542 few lines that happen to match textually as the context, but as a
1543 single deletion of everything old followed by a single insertion of
1544 everything new, and the number
<code>m
</code> controls this aspect of the -B
1545 option (defaults to
60%).
<code>-B/
70%
</code> specifies that less than
30% of the
1546 original should remain in the result for Git to consider it a total
1547 rewrite (i.e. otherwise the resulting patch will be a series of
1548 deletion and insertion mixed together with context lines).
</p></div>
1549 <div class=
"paragraph"><p>When used with -M, a totally-rewritten file is also considered as the
1550 source of a rename (usually -M only considers a file that disappeared
1551 as the source of a rename), and the number
<code>n
</code> controls this aspect of
1552 the -B option (defaults to
50%).
<code>-B20%
</code> specifies that a change with
1553 addition and deletion compared to
20% or more of the file
’s size are
1554 eligible for being picked up as a possible source of a rename to
1555 another file.
</p></div>
1557 <dt class=
"hdlist1">
1560 <dt class=
"hdlist1">
1561 --find-renames[=
<n
>]
1566 If
<code>n
</code> is specified, it is a threshold on the similarity
1567 index (i.e. amount of addition/deletions compared to the
1568 file
’s size). For example,
<code>-M90%
</code> means Git should consider a
1569 delete/add pair to be a rename if more than
90% of the file
1570 hasn
’t changed. Without a
<code>%
</code> sign, the number is to be read as
1571 a fraction, with a decimal point before it. I.e.,
<code>-M5
</code> becomes
1572 0.5, and is thus the same as
<code>-M50%
</code>. Similarly,
<code>-M05
</code> is
1573 the same as
<code>-M5%
</code>. To limit detection to exact renames, use
1574 <code>-M100%
</code>. The default similarity index is
50%.
1577 <dt class=
"hdlist1">
1580 <dt class=
"hdlist1">
1581 --find-copies[=
<n
>]
1585 Detect copies as well as renames. See also
<code>--find-copies-harder
</code>.
1586 If
<code>n
</code> is specified, it has the same meaning as for
<code>-M
<n
></code>.
1589 <dt class=
"hdlist1">
1590 --find-copies-harder
1594 For performance reasons, by default,
<code>-C
</code> option finds copies only
1595 if the original file of the copy was modified in the same
1596 changeset. This flag makes the command
1597 inspect unmodified files as candidates for the source of
1598 copy. This is a very expensive operation for large
1599 projects, so use it with caution. Giving more than one
1600 <code>-C
</code> option has the same effect.
1603 <dt class=
"hdlist1">
1606 <dt class=
"hdlist1">
1607 --irreversible-delete
1611 Omit the preimage for deletes, i.e. print only the header but not
1612 the diff between the preimage and
<code>/dev/null
</code>. The resulting patch
1613 is not meant to be applied with
<code>patch
</code> or
<code>git apply
</code>; this is
1614 solely for people who want to just concentrate on reviewing the
1615 text after the change. In addition, the output obviously lacks
1616 enough information to apply such a patch in reverse, even manually,
1617 hence the name of the option.
1619 <div class=
"paragraph"><p>When used together with
<code>-B
</code>, omit also the preimage in the deletion part
1620 of a delete/create pair.
</p></div>
1622 <dt class=
"hdlist1">
1627 The
<code>-M
</code> and
<code>-C
</code> options involve some preliminary steps that
1628 can detect subsets of renames/copies cheaply, followed by an
1629 exhaustive fallback portion that compares all remaining
1630 unpaired destinations to all relevant sources. (For renames,
1631 only remaining unpaired sources are relevant; for copies, all
1632 original sources are relevant.) For N sources and
1633 destinations, this exhaustive check is O(N^
2). This option
1634 prevents the exhaustive portion of rename/copy detection from
1635 running if the number of source/destination files involved
1636 exceeds the specified number. Defaults to diff.renameLimit.
1637 Note that a value of
0 is treated as unlimited.
1640 <dt class=
"hdlist1">
1641 --diff-filter=[(A|C|D|M|R|T|U|X|B)
…[*]]
1645 Select only files that are Added (
<code>A
</code>), Copied (
<code>C
</code>),
1646 Deleted (
<code>D
</code>), Modified (
<code>M
</code>), Renamed (
<code>R
</code>), have their
1647 type (i.e. regular file, symlink, submodule,
…) changed (
<code>T
</code>),
1648 are Unmerged (
<code>U
</code>), are
1649 Unknown (
<code>X
</code>), or have had their pairing Broken (
<code>B
</code>).
1650 Any combination of the filter characters (including none) can be used.
1651 When
<code>*
</code> (All-or-none) is added to the combination, all
1652 paths are selected if there is any file that matches
1653 other criteria in the comparison; if there is no file
1654 that matches other criteria, nothing is selected.
1656 <div class=
"paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g.
1657 <code>--diff-filter=ad
</code> excludes added and deleted paths.
</p></div>
1658 <div class=
"paragraph"><p>Note that not all diffs can feature all types. For instance, copied and
1659 renamed entries cannot appear if detection for those types is disabled.
</p></div>
1661 <dt class=
"hdlist1">
1666 Look for differences that change the number of occurrences of
1667 the specified string (i.e. addition/deletion) in a file.
1668 Intended for the scripter
’s use.
1670 <div class=
"paragraph"><p>It is useful when you
’re looking for an exact block of code (like a
1671 struct), and want to know the history of that block since it first
1672 came into being: use the feature iteratively to feed the interesting
1673 block in the preimage back into
<code>-S
</code>, and keep going until you get the
1674 very first version of the block.
</p></div>
1675 <div class=
"paragraph"><p>Binary files are searched as well.
</p></div>
1677 <dt class=
"hdlist1">
1682 Look for differences whose patch text contains added/removed
1683 lines that match
<regex
>.
1685 <div class=
"paragraph"><p>To illustrate the difference between
<code>-S
<regex
> --pickaxe-regex
</code> and
1686 <code>-G
<regex
></code>, consider a commit with the following diff in the same
1688 <div class=
"listingblock">
1689 <div class=
"content">
1690 <pre><code>+ return frotz(nitfol, two-
>ptr,
1,
0);
1692 - hit = frotz(nitfol, mf2.ptr,
1,
0);
</code></pre>
1694 <div class=
"paragraph"><p>While
<code>git log -G
"frotz\(nitfol"</code> will show this commit,
<code>git log
1695 -S
"frotz\(nitfol" --pickaxe-regex
</code> will not (because the number of
1696 occurrences of that string did not change).
</p></div>
1697 <div class=
"paragraph"><p>Unless
<code>--text
</code> is supplied patches of binary files without a textconv
1698 filter will be ignored.
</p></div>
1699 <div class=
"paragraph"><p>See the
<em>pickaxe
</em> entry in
<a href=
"gitdiffcore.html">gitdiffcore(
7)
</a> for more
1700 information.
</p></div>
1702 <dt class=
"hdlist1">
1703 --find-object=
<object-id
>
1707 Look for differences that change the number of occurrences of
1708 the specified object. Similar to
<code>-S
</code>, just the argument is different
1709 in that it doesn
’t search for a specific string but for a specific
1712 <div class=
"paragraph"><p>The object can be a blob or a submodule commit. It implies the
<code>-t
</code> option in
1713 <code>git-log
</code> to also find trees.
</p></div>
1715 <dt class=
"hdlist1">
1720 When
<code>-S
</code> or
<code>-G
</code> finds a change, show all the changes in that
1721 changeset, not just the files that contain the change
1725 <dt class=
"hdlist1">
1730 Treat the
<string
> given to
<code>-S
</code> as an extended POSIX regular
1731 expression to match.
1734 <dt class=
"hdlist1">
1739 Control the order in which files appear in the output.
1740 This overrides the
<code>diff.orderFile
</code> configuration variable
1741 (see
<a href=
"git-config.html">git-config(
1)
</a>). To cancel
<code>diff.orderFile
</code>,
1742 use
<code>-O/dev/null
</code>.
1744 <div class=
"paragraph"><p>The output order is determined by the order of glob patterns in
1746 All files with pathnames that match the first pattern are output
1747 first, all files with pathnames that match the second pattern (but not
1748 the first) are output next, and so on.
1749 All files with pathnames that do not match any pattern are output
1750 last, as if there was an implicit match-all pattern at the end of the
1752 If multiple pathnames have the same rank (they match the same pattern
1753 but no earlier patterns), their output order relative to each other is
1754 the normal order.
</p></div>
1755 <div class=
"paragraph"><p><orderfile
> is parsed as follows:
</p></div>
1756 <div class=
"openblock">
1757 <div class=
"content">
1758 <div class=
"ulist"><ul>
1761 Blank lines are ignored, so they can be used as separators for
1767 Lines starting with a hash (
"<code>#</code>") are ignored, so they can be used
1768 for comments. Add a backslash (
"<code>\</code>") to the beginning of the
1769 pattern if it starts with a hash.
1774 Each other line contains a single pattern.
1779 <div class=
"paragraph"><p>Patterns have the same syntax and semantics as patterns used for
1780 fnmatch(
3) without the FNM_PATHNAME flag, except a pathname also
1781 matches a pattern if removing any number of the final pathname
1782 components matches the pattern. For example, the pattern
"<code>foo*bar</code>"
1783 matches
"<code>fooasdfbar</code>" and
"<code>foo/bar/baz/asdf</code>" but not
"<code>foobarx</code>".
</p></div>
1785 <dt class=
"hdlist1">
1786 --skip-to=
<file
>
1788 <dt class=
"hdlist1">
1789 --rotate-to=
<file
>
1793 Discard the files before the named
<file
> from the output
1794 (i.e.
<em>skip to
</em>), or move them to the end of the output
1795 (i.e.
<em>rotate to
</em>). These were invented primarily for use
1796 of the
<code>git difftool
</code> command, and may not be very useful
1800 <dt class=
"hdlist1">
1805 Swap two inputs; that is, show differences from index or
1806 on-disk file to tree contents.
1809 <dt class=
"hdlist1">
1810 --relative[=
<path
>]
1812 <dt class=
"hdlist1">
1817 When run from a subdirectory of the project, it can be
1818 told to exclude changes outside the directory and show
1819 pathnames relative to it with this option. When you are
1820 not in a subdirectory (e.g. in a bare repository), you
1821 can name which subdirectory to make the output relative
1822 to by giving a
<path
> as an argument.
1823 <code>--no-relative
</code> can be used to countermand both
<code>diff.relative
</code> config
1824 option and previous
<code>--relative
</code>.
1827 <dt class=
"hdlist1">
1830 <dt class=
"hdlist1">
1835 Treat all files as text.
1838 <dt class=
"hdlist1">
1843 Ignore carriage-return at the end of line when doing a comparison.
1846 <dt class=
"hdlist1">
1847 --ignore-space-at-eol
1851 Ignore changes in whitespace at EOL.
1854 <dt class=
"hdlist1">
1857 <dt class=
"hdlist1">
1858 --ignore-space-change
1862 Ignore changes in amount of whitespace. This ignores whitespace
1863 at line end, and considers all other sequences of one or
1864 more whitespace characters to be equivalent.
1867 <dt class=
"hdlist1">
1870 <dt class=
"hdlist1">
1875 Ignore whitespace when comparing lines. This ignores
1876 differences even if one line has whitespace where the other
1880 <dt class=
"hdlist1">
1881 --ignore-blank-lines
1885 Ignore changes whose lines are all blank.
1888 <dt class=
"hdlist1">
1891 <dt class=
"hdlist1">
1892 --ignore-matching-lines=
<regex
>
1896 Ignore changes whose all lines match
<regex
>. This option may
1897 be specified more than once.
1900 <dt class=
"hdlist1">
1901 --inter-hunk-context=
<lines
>
1905 Show the context between diff hunks, up to the specified number
1906 of lines, thereby fusing hunks that are close to each other.
1907 Defaults to
<code>diff.interHunkContext
</code> or
0 if the config option
1911 <dt class=
"hdlist1">
1914 <dt class=
"hdlist1">
1919 Show whole function as context lines for each change.
1920 The function names are determined in the same way as
1921 <code>git diff
</code> works out patch hunk headers (see
<em>Defining a
1922 custom hunk-header
</em> in
<a href=
"gitattributes.html">gitattributes(
5)
</a>).
1925 <dt class=
"hdlist1">
1930 Make the program exit with codes similar to diff(
1).
1931 That is, it exits with
1 if there were differences and
1932 0 means no differences.
1935 <dt class=
"hdlist1">
1940 Disable all output of the program. Implies
<code>--exit-code
</code>.
1943 <dt class=
"hdlist1">
1948 Allow an external diff helper to be executed. If you set an
1949 external diff driver with
<a href=
"gitattributes.html">gitattributes(
5)
</a>, you need
1950 to use this option with
<a href=
"git-log.html">git-log(
1)
</a> and friends.
1953 <dt class=
"hdlist1">
1958 Disallow external diff drivers.
1961 <dt class=
"hdlist1">
1964 <dt class=
"hdlist1">
1969 Allow (or disallow) external text conversion filters to be run
1970 when comparing binary files. See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for
1971 details. Because textconv filters are typically a one-way
1972 conversion, the resulting diff is suitable for human
1973 consumption, but cannot be applied. For this reason, textconv
1974 filters are enabled by default only for
<a href=
"git-diff.html">git-diff(
1)
</a> and
1975 <a href=
"git-log.html">git-log(
1)
</a>, but not for
<a href=
"git-format-patch.html">git-format-patch(
1)
</a> or
1976 diff plumbing commands.
1979 <dt class=
"hdlist1">
1980 --ignore-submodules[=
<when
>]
1984 Ignore changes to submodules in the diff generation.
<when
> can be
1985 either
"none",
"untracked",
"dirty" or
"all", which is the default.
1986 Using
"none" will consider the submodule modified when it either contains
1987 untracked or modified files or its HEAD differs from the commit recorded
1988 in the superproject and can be used to override any settings of the
1989 <em>ignore
</em> option in
<a href=
"git-config.html">git-config(
1)
</a> or
<a href=
"gitmodules.html">gitmodules(
5)
</a>. When
1990 "untracked" is used submodules are not considered dirty when they only
1991 contain untracked content (but they are still scanned for modified
1992 content). Using
"dirty" ignores all changes to the work tree of submodules,
1993 only changes to the commits stored in the superproject are shown (this was
1994 the behavior until
1.7.0). Using
"all" hides all changes to submodules.
1997 <dt class=
"hdlist1">
1998 --src-prefix=
<prefix
>
2002 Show the given source prefix instead of
"a/".
2005 <dt class=
"hdlist1">
2006 --dst-prefix=
<prefix
>
2010 Show the given destination prefix instead of
"b/".
2013 <dt class=
"hdlist1">
2018 Do not show any source or destination prefix.
2021 <dt class=
"hdlist1">
2026 Use the default source and destination prefixes (
"a/" and
"b/").
2027 This is usually the default already, but may be used to override
2028 config such as
<code>diff.noprefix
</code>.
2031 <dt class=
"hdlist1">
2032 --line-prefix=
<prefix
>
2036 Prepend an additional prefix to every line of output.
2039 <dt class=
"hdlist1">
2040 --ita-invisible-in-index
2044 By default entries added by
"git add -N" appear as an existing
2045 empty file in
"git diff" and a new file in
"git diff --cached".
2046 This option makes the entry appear as a new file in
"git diff"
2047 and non-existent in
"git diff --cached". This option could be
2048 reverted with
<code>--ita-visible-in-index
</code>. Both options are
2049 experimental and could be removed in future.
2053 <div class=
"paragraph"><p>For more detailed explanation on these common options, see also
2054 <a href=
"gitdiffcore.html">gitdiffcore(
7)
</a>.
</p></div>
2055 <div class=
"dlist"><dl>
2056 <dt class=
"hdlist1">
2061 The id of a tree object.
2064 <dt class=
"hdlist1">
2069 If provided, the results are limited to a subset of files
2070 matching one of the provided pathspecs.
2073 <dt class=
"hdlist1">
2078 recurse into sub-trees
2081 <dt class=
"hdlist1">
2086 show tree entry itself as well as subtrees. Implies -r.
2089 <dt class=
"hdlist1">
2094 When
<code>--root
</code> is specified the initial commit will be shown as a big
2095 creation event. This is equivalent to a diff against the NULL tree.
2098 <dt class=
"hdlist1">
2103 Instead of comparing the
<tree-ish
>s directly, use the merge
2104 base between the two
<tree-ish
>s as the
"before" side. There
2105 must be two
<tree-ish
>s given and they must both be commits.
2108 <dt class=
"hdlist1">
2113 When
<code>--stdin
</code> is specified, the command does not take
2114 <tree-ish
> arguments from the command line. Instead, it
2115 reads lines containing either two
<tree
>, one
<commit
>, or a
2116 list of
<commit
> from its standard input. (Use a single space
2119 <div class=
"paragraph"><p>When two trees are given, it compares the first tree with the second.
2120 When a single commit is given, it compares the commit with its
2121 parents. The remaining commits, when given, are used as if they are
2122 parents of the first commit.
</p></div>
2123 <div class=
"paragraph"><p>When comparing two trees, the ID of both trees (separated by a space
2124 and terminated by a newline) is printed before the difference. When
2125 comparing commits, the ID of the first (or only) commit, followed by a
2126 newline, is printed.
</p></div>
2127 <div class=
"paragraph"><p>The following flags further affect the behavior when comparing
2128 commits (but not trees).
</p></div>
2130 <dt class=
"hdlist1">
2135 By default,
<em>git diff-tree --stdin
</em> does not show
2136 differences for merge commits. With this flag, it shows
2137 differences to that commit from all of its parents. See
2138 also
<code>-c
</code>.
2141 <dt class=
"hdlist1">
2146 By default,
<em>git diff-tree --stdin
</em> shows differences,
2147 either in machine-readable form (without
<code>-p
</code>) or in patch
2148 form (with
<code>-p
</code>). This output can be suppressed. It is
2149 only useful with
<code>-v
</code> flag.
2152 <dt class=
"hdlist1">
2157 This flag causes
<em>git diff-tree --stdin
</em> to also show
2158 the commit message before the differences.
2161 <dt class=
"hdlist1">
2162 --pretty[=
<format
>]
2164 <dt class=
"hdlist1">
2165 --format=
<format
>
2169 Pretty-print the contents of the commit logs in a given format,
2170 where
<em><format
></em> can be one of
<em>oneline
</em>,
<em>short
</em>,
<em>medium
</em>,
2171 <em>full
</em>,
<em>fuller
</em>,
<em>reference
</em>,
<em>email
</em>,
<em>raw
</em>,
<em>format:
<string
></em>
2172 and
<em>tformat:
<string
></em>. When
<em><format
></em> is none of the above,
2173 and has
<em>%placeholder
</em> in it, it acts as if
2174 <em>--pretty=tformat:
<format
></em> were given.
2176 <div class=
"paragraph"><p>See the
"PRETTY FORMATS" section for some additional details for each
2177 format. When
<em>=
<format
></em> part is omitted, it defaults to
<em>medium
</em>.
</p></div>
2178 <div class=
"paragraph"><p>Note: you can specify the default pretty format in the repository
2179 configuration (see
<a href=
"git-config.html">git-config(
1)
</a>).
</p></div>
2181 <dt class=
"hdlist1">
2186 Instead of showing the full
40-byte hexadecimal commit object
2187 name, show a prefix that names the object uniquely.
2188 "--abbrev=<n>" (which also modifies diff output, if it is displayed)
2189 option can be used to specify the minimum length of the prefix.
2191 <div class=
"paragraph"><p>This should make
"--pretty=oneline" a whole lot more readable for
2192 people using
80-column terminals.
</p></div>
2194 <dt class=
"hdlist1">
2199 Show the full
40-byte hexadecimal commit object name. This negates
2200 <code>--abbrev-commit
</code>, either explicit or implied by other options such
2201 as
"--oneline". It also overrides the
<code>log.abbrevCommit
</code> variable.
2204 <dt class=
"hdlist1">
2209 This is a shorthand for
"--pretty=oneline --abbrev-commit"
2213 <dt class=
"hdlist1">
2214 --encoding=
<encoding
>
2218 Commit objects record the character encoding used for the log message
2219 in their encoding header; this option can be used to tell the
2220 command to re-code the commit log message in the encoding
2221 preferred by the user. For non plumbing commands this
2222 defaults to UTF-
8. Note that if an object claims to be encoded
2223 in
<code>X
</code> and we are outputting in
<code>X
</code>, we will output the object
2224 verbatim; this means that invalid sequences in the original
2225 commit may be copied to the output. Likewise, if iconv(
3) fails
2226 to convert the commit, we will quietly output the original
2230 <dt class=
"hdlist1">
2231 --expand-tabs=
<n
>
2233 <dt class=
"hdlist1">
2236 <dt class=
"hdlist1">
2241 Perform a tab expansion (replace each tab with enough spaces
2242 to fill to the next display column that is multiple of
<em><n
></em>)
2243 in the log message before showing it in the output.
2244 <code>--expand-tabs
</code> is a short-hand for
<code>--expand-tabs=
8</code>, and
2245 <code>--no-expand-tabs
</code> is a short-hand for
<code>--expand-tabs=
0</code>,
2246 which disables tab expansion.
2248 <div class=
"paragraph"><p>By default, tabs are expanded in pretty formats that indent the log
2249 message by
4 spaces (i.e.
<em>medium
</em>, which is the default,
<em>full
</em>,
2250 and
<em>fuller
</em>).
</p></div>
2252 <dt class=
"hdlist1">
2253 --notes[=
<ref
>]
2257 Show the notes (see
<a href=
"git-notes.html">git-notes(
1)
</a>) that annotate the
2258 commit, when showing the commit log message. This is the default
2259 for
<code>git log
</code>,
<code>git show
</code> and
<code>git whatchanged
</code> commands when
2260 there is no
<code>--pretty
</code>,
<code>--format
</code>, or
<code>--oneline
</code> option given
2261 on the command line.
2263 <div class=
"paragraph"><p>By default, the notes shown are from the notes refs listed in the
2264 <code>core.notesRef
</code> and
<code>notes.displayRef
</code> variables (or corresponding
2265 environment overrides). See
<a href=
"git-config.html">git-config(
1)
</a> for more details.
</p></div>
2266 <div class=
"paragraph"><p>With an optional
<em><ref
></em> argument, use the ref to find the notes
2267 to display. The ref can specify the full refname when it begins
2268 with
<code>refs/notes/
</code>; when it begins with
<code>notes/
</code>,
<code>refs/
</code> and otherwise
2269 <code>refs/notes/
</code> is prefixed to form a full name of the ref.
</p></div>
2270 <div class=
"paragraph"><p>Multiple --notes options can be combined to control which notes are
2271 being displayed. Examples:
"--notes=foo" will show only notes from
2272 "refs/notes/foo";
"--notes=foo --notes" will show both notes from
2273 "refs/notes/foo" and from the default notes ref(s).
</p></div>
2275 <dt class=
"hdlist1">
2280 Do not show notes. This negates the above
<code>--notes
</code> option, by
2281 resetting the list of notes refs from which notes are shown.
2282 Options are parsed in the order given on the command line, so e.g.
2283 "--notes --notes=foo --no-notes --notes=bar" will only show notes
2284 from
"refs/notes/bar".
2287 <dt class=
"hdlist1">
2288 --show-notes[=
<ref
>]
2290 <dt class=
"hdlist1">
2291 --[no-]standard-notes
2295 These options are deprecated. Use the above --notes/--no-notes
2299 <dt class=
"hdlist1">
2304 Check the validity of a signed commit object by passing the signature
2305 to
<code>gpg --verify
</code> and show the output.
2308 <dt class=
"hdlist1">
2313 <em>git diff-tree
</em> outputs a line with the commit ID when
2314 applicable. This flag suppressed the commit ID output.
2317 <dt class=
"hdlist1">
2322 This flag changes the way a merge commit is displayed
2323 (which means it is useful only when the command is given
2324 one
<tree-ish
>, or
<code>--stdin
</code>). It shows the differences
2325 from each of the parents to the merge result simultaneously
2326 instead of showing pairwise diff between a parent and the
2327 result one at a time (which is what the
<code>-m
</code> option does).
2328 Furthermore, it lists only files which were modified
2332 <dt class=
"hdlist1">
2337 This flag changes the way a merge commit patch is displayed,
2338 in a similar way to the
<code>-c
</code> option. It implies the
<code>-c
</code>
2339 and
<code>-p
</code> options and further compresses the patch output
2340 by omitting uninteresting hunks whose the contents in the parents
2341 have only two variants and the merge result picks one of them
2342 without modification. When all hunks are uninteresting, the commit
2343 itself and the commit log message is not shown, just like in any other
2347 <dt class=
"hdlist1">
2348 --combined-all-paths
2352 This flag causes combined diffs (used for merge commits) to
2353 list the name of the file from all parents. It thus only has
2354 effect when -c or --cc are specified, and is likely only
2355 useful if filename changes are detected (i.e. when either
2356 rename or copy detection have been requested).
2359 <dt class=
"hdlist1">
2364 Show the commit itself and the commit log message even
2365 if the diff itself is empty.
2372 <h2 id=
"_pretty_formats">PRETTY FORMATS
</h2>
2373 <div class=
"sectionbody">
2374 <div class=
"paragraph"><p>If the commit is a merge, and if the pretty-format
2375 is not
<em>oneline
</em>,
<em>email
</em> or
<em>raw
</em>, an additional line is
2376 inserted before the
<em>Author:
</em> line. This line begins with
2377 "Merge: " and the hashes of ancestral commits are printed,
2378 separated by spaces. Note that the listed commits may not
2379 necessarily be the list of the
<strong>direct
</strong> parent commits if you
2380 have limited your view of history: for example, if you are
2381 only interested in changes related to a certain directory or
2383 <div class=
"paragraph"><p>There are several built-in formats, and you can define
2384 additional formats by setting a pretty.
<name
>
2385 config option to either another format name, or a
2386 <em>format:
</em> string, as described below (see
2387 <a href=
"git-config.html">git-config(
1)
</a>). Here are the details of the
2388 built-in formats:
</p></div>
2389 <div class=
"ulist"><ul>
2394 <div class=
"literalblock">
2395 <div class=
"content">
2396 <pre><code><hash
> <title-line
></code></pre>
2398 <div class=
"paragraph"><p>This is designed to be as compact as possible.
</p></div>
2404 <div class=
"literalblock">
2405 <div class=
"content">
2406 <pre><code>commit
<hash
>
2407 Author:
<author
></code></pre>
2409 <div class=
"literalblock">
2410 <div class=
"content">
2411 <pre><code><title-line
></code></pre>
2418 <div class=
"literalblock">
2419 <div class=
"content">
2420 <pre><code>commit
<hash
>
2421 Author:
<author
>
2422 Date:
<author-date
></code></pre>
2424 <div class=
"literalblock">
2425 <div class=
"content">
2426 <pre><code><title-line
></code></pre>
2428 <div class=
"literalblock">
2429 <div class=
"content">
2430 <pre><code><full-commit-message
></code></pre>
2437 <div class=
"literalblock">
2438 <div class=
"content">
2439 <pre><code>commit
<hash
>
2440 Author:
<author
>
2441 Commit:
<committer
></code></pre>
2443 <div class=
"literalblock">
2444 <div class=
"content">
2445 <pre><code><title-line
></code></pre>
2447 <div class=
"literalblock">
2448 <div class=
"content">
2449 <pre><code><full-commit-message
></code></pre>
2456 <div class=
"literalblock">
2457 <div class=
"content">
2458 <pre><code>commit
<hash
>
2459 Author:
<author
>
2460 AuthorDate:
<author-date
>
2461 Commit:
<committer
>
2462 CommitDate:
<committer-date
></code></pre>
2464 <div class=
"literalblock">
2465 <div class=
"content">
2466 <pre><code><title-line
></code></pre>
2468 <div class=
"literalblock">
2469 <div class=
"content">
2470 <pre><code><full-commit-message
></code></pre>
2477 <div class=
"literalblock">
2478 <div class=
"content">
2479 <pre><code><abbrev-hash
> (
<title-line
>,
<short-author-date
>)
</code></pre>
2481 <div class=
"paragraph"><p>This format is used to refer to another commit in a commit message and
2482 is the same as
<code>--pretty='format:%C(auto)%h (%s, %ad)'
</code>. By default,
2483 the date is formatted with
<code>--date=short
</code> unless another
<code>--date
</code> option
2484 is explicitly specified. As with any
<code>format:
</code> with format
2485 placeholders, its output is not affected by other options like
2486 <code>--decorate
</code> and
<code>--walk-reflogs
</code>.
</p></div>
2492 <div class=
"literalblock">
2493 <div class=
"content">
2494 <pre><code>From
<hash
> <date
>
2495 From:
<author
>
2496 Date:
<author-date
>
2497 Subject: [PATCH]
<title-line
></code></pre>
2499 <div class=
"literalblock">
2500 <div class=
"content">
2501 <pre><code><full-commit-message
></code></pre>
2508 <div class=
"paragraph"><p>Like
<em>email
</em>, but lines in the commit message starting with
"From "
2509 (preceded by zero or more
">") are quoted with
">" so they aren
’t
2510 confused as starting a new commit.
</p></div>
2516 <div class=
"paragraph"><p>The
<em>raw
</em> format shows the entire commit exactly as
2517 stored in the commit object. Notably, the hashes are
2518 displayed in full, regardless of whether --abbrev or
2519 --no-abbrev are used, and
<em>parents
</em> information show the
2520 true parent commits, without taking grafts or history
2521 simplification into account. Note that this format affects the way
2522 commits are displayed, but not the way the diff is shown e.g. with
2523 <code>git log --raw
</code>. To get full object names in a raw diff format,
2524 use
<code>--no-abbrev
</code>.
</p></div>
2528 <em>format:
<format-string
></em>
2530 <div class=
"paragraph"><p>The
<em>format:
<format-string
></em> format allows you to specify which information
2531 you want to show. It works a little bit like printf format,
2532 with the notable exception that you get a newline with
<em>%n
</em>
2533 instead of
<em>\n
</em>.
</p></div>
2534 <div class=
"paragraph"><p>E.g,
<em>format:
"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em>
2535 would show something like this:
</p></div>
2536 <div class=
"listingblock">
2537 <div class=
"content">
2538 <pre><code>The author of fe6e0ee was Junio C Hamano,
23 hours ago
2539 The title was
>>t4119: test autocomputing -p
<n
> for traditional diff input.
<<</code></pre>
2541 <div class=
"paragraph"><p>The placeholders are:
</p></div>
2542 <div class=
"ulist"><ul>
2545 Placeholders that expand to a single literal character:
2547 <div class=
"dlist"><dl>
2548 <dt class=
"hdlist1">
2556 <dt class=
"hdlist1">
2564 <dt class=
"hdlist1">
2569 print a byte from a hex code
2576 Placeholders that affect formatting of later placeholders:
2578 <div class=
"dlist"><dl>
2579 <dt class=
"hdlist1">
2587 <dt class=
"hdlist1">
2592 switch color to green
2595 <dt class=
"hdlist1">
2600 switch color to blue
2603 <dt class=
"hdlist1">
2611 <dt class=
"hdlist1">
2612 <em>%C(
…)
</em>
2616 color specification, as described under Values in the
2617 "CONFIGURATION FILE" section of
<a href=
"git-config.html">git-config(
1)
</a>. By
2618 default, colors are shown only when enabled for log output
2619 (by
<code>color.diff
</code>,
<code>color.ui
</code>, or
<code>--color
</code>, and respecting
2620 the
<code>auto
</code> settings of the former if we are going to a
2621 terminal).
<code>%C(auto,...)
</code> is accepted as a historical
2622 synonym for the default (e.g.,
<code>%C(auto,red)
</code>). Specifying
2623 <code>%C(always,...)
</code> will show the colors even when color is
2624 not otherwise enabled (though consider just using
2625 <code>--color=always
</code> to enable color for the whole output,
2626 including this format and anything else git might color).
2627 <code>auto
</code> alone (i.e.
<code>%C(auto)
</code>) will turn on auto coloring
2628 on the next placeholders until the color is switched
2632 <dt class=
"hdlist1">
2637 left (
<code><</code>), right (
<code>></code>) or boundary (
<code>-
</code>) mark
2640 <dt class=
"hdlist1">
2641 <em>%w([
<w
>[,
<i1
>[,
<i2
>]]])
</em>
2645 switch line wrapping, like the -w option of
2646 <a href=
"git-shortlog.html">git-shortlog(
1)
</a>.
2649 <dt class=
"hdlist1">
2650 <em>%
<(
<N
> [,trunc|ltrunc|mtrunc])
</em>
2654 make the next placeholder take at
2655 least N column widths, padding spaces on
2656 the right if necessary. Optionally
2657 truncate (with ellipsis
<em>..
</em>) at the left (ltrunc)
<code>..ft
</code>,
2658 the middle (mtrunc)
<code>mi..le
</code>, or the end
2659 (trunc)
<code>rig..
</code>, if the output is longer than
2661 Note
1: that truncating
2662 only works correctly with N
>=
2.
2663 Note
2: spaces around the N and M (see below)
2664 values are optional.
2665 Note
3: Emojis and other wide characters
2666 will take two display columns, which may
2667 over-run column boundaries.
2668 Note
4: decomposed character combining marks
2669 may be misplaced at padding boundaries.
2672 <dt class=
"hdlist1">
2673 <em>%
<|(
<M
> )
</em>
2677 make the next placeholder take at least until Mth
2678 display column, padding spaces on the right if necessary.
2679 Use negative M values for column positions measured
2680 from the right hand edge of the terminal window.
2683 <dt class=
"hdlist1">
2684 <em>%
>(
<N
> )
</em>,
<em>%
>|(
<M
> )
</em>
2688 similar to
<em>%
<(
<N
> )
</em>,
<em>%
<|(
<M
> )
</em> respectively,
2689 but padding spaces on the left
2692 <dt class=
"hdlist1">
2693 <em>%
>>(
<N
> )
</em>,
<em>%
>>|(
<M
> )
</em>
2697 similar to
<em>%
>(
<N
> )
</em>,
<em>%
>|(
<M
> )
</em>
2698 respectively, except that if the next
2699 placeholder takes more spaces than given and
2700 there are spaces on its left, use those
2704 <dt class=
"hdlist1">
2705 <em>%
><(
<N
> )
</em>,
<em>%
><|(
<M
> )
</em>
2709 similar to
<em>%
<(
<N
> )
</em>,
<em>%
<|(
<M
> )
</em>
2710 respectively, but padding both sides
2711 (i.e. the text is centered)
2718 Placeholders that expand to information extracted from the commit:
2720 <div class=
"dlist"><dl>
2721 <dt class=
"hdlist1">
2729 <dt class=
"hdlist1">
2734 abbreviated commit hash
2737 <dt class=
"hdlist1">
2745 <dt class=
"hdlist1">
2750 abbreviated tree hash
2753 <dt class=
"hdlist1">
2761 <dt class=
"hdlist1">
2766 abbreviated parent hashes
2769 <dt class=
"hdlist1">
2777 <dt class=
"hdlist1">
2782 author name (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a>
2783 or
<a href=
"git-blame.html">git-blame(
1)
</a>)
2786 <dt class=
"hdlist1">
2794 <dt class=
"hdlist1">
2799 author email (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a>
2800 or
<a href=
"git-blame.html">git-blame(
1)
</a>)
2803 <dt class=
"hdlist1">
2808 author email local-part (the part before the
<em>@
</em> sign)
2811 <dt class=
"hdlist1">
2816 author local-part (see
<em>%al
</em>) respecting .mailmap, see
2817 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
2820 <dt class=
"hdlist1">
2825 author date (format respects --date= option)
2828 <dt class=
"hdlist1">
2833 author date, RFC2822 style
2836 <dt class=
"hdlist1">
2841 author date, relative
2844 <dt class=
"hdlist1">
2849 author date, UNIX timestamp
2852 <dt class=
"hdlist1">
2857 author date, ISO
8601-like format
2860 <dt class=
"hdlist1">
2865 author date, strict ISO
8601 format
2868 <dt class=
"hdlist1">
2873 author date, short format (
<code>YYYY-MM-DD
</code>)
2876 <dt class=
"hdlist1">
2881 author date, human style (like the
<code>--date=human
</code> option of
2882 <a href=
"git-rev-list.html">git-rev-list(
1)
</a>)
2885 <dt class=
"hdlist1">
2893 <dt class=
"hdlist1">
2898 committer name (respecting .mailmap, see
2899 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
2902 <dt class=
"hdlist1">
2910 <dt class=
"hdlist1">
2915 committer email (respecting .mailmap, see
2916 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
2919 <dt class=
"hdlist1">
2924 committer email local-part (the part before the
<em>@
</em> sign)
2927 <dt class=
"hdlist1">
2932 committer local-part (see
<em>%cl
</em>) respecting .mailmap, see
2933 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
2936 <dt class=
"hdlist1">
2941 committer date (format respects --date= option)
2944 <dt class=
"hdlist1">
2949 committer date, RFC2822 style
2952 <dt class=
"hdlist1">
2957 committer date, relative
2960 <dt class=
"hdlist1">
2965 committer date, UNIX timestamp
2968 <dt class=
"hdlist1">
2973 committer date, ISO
8601-like format
2976 <dt class=
"hdlist1">
2981 committer date, strict ISO
8601 format
2984 <dt class=
"hdlist1">
2989 committer date, short format (
<code>YYYY-MM-DD
</code>)
2992 <dt class=
"hdlist1">
2997 committer date, human style (like the
<code>--date=human
</code> option of
2998 <a href=
"git-rev-list.html">git-rev-list(
1)
</a>)
3001 <dt class=
"hdlist1">
3006 ref names, like the --decorate option of
<a href=
"git-log.html">git-log(
1)
</a>
3009 <dt class=
"hdlist1">
3014 ref names without the
" (",
")" wrapping.
3017 <dt class=
"hdlist1">
3018 <em>%(describe[:options])
</em>
3022 human-readable name, like
3023 <a href=
"git-describe.html">git-describe(
1)
</a>; empty string for
3024 undescribable commits. The
<code>describe
</code> string
3025 may be followed by a colon and zero or more
3026 comma-separated options. Descriptions can be
3027 inconsistent when tags are added or removed at
3030 <div class=
"ulist"><ul>
3033 <em>tags[=
<bool-value
>]
</em>: Instead of only considering annotated tags,
3034 consider lightweight tags as well.
3039 <em>abbrev=
<number
></em>: Instead of using the default number of hexadecimal digits
3040 (which will vary according to the number of objects in the repository with a
3041 default of
7) of the abbreviated object name, use
<number
> digits, or as many
3042 digits as needed to form a unique object name.
3047 <em>match=
<pattern
></em>: Only consider tags matching the given
3048 <code>glob(
7)
</code> pattern, excluding the
"refs/tags/" prefix.
3053 <em>exclude=
<pattern
></em>: Do not consider tags matching the given
3054 <code>glob(
7)
</code> pattern, excluding the
"refs/tags/" prefix.
3059 <dt class=
"hdlist1">
3064 ref name given on the command line by which the commit was reached
3065 (like
<code>git log --source
</code>), only works with
<code>git log
</code>
3068 <dt class=
"hdlist1">
3076 <dt class=
"hdlist1">
3084 <dt class=
"hdlist1">
3089 sanitized subject line, suitable for a filename
3092 <dt class=
"hdlist1">
3100 <dt class=
"hdlist1">
3105 raw body (unwrapped subject and body)
3108 <dt class=
"hdlist1">
3116 <dt class=
"hdlist1">
3121 raw verification message from GPG for a signed commit
3124 <dt class=
"hdlist1">
3129 show
"G" for a good (valid) signature,
3130 "B" for a bad signature,
3131 "U" for a good signature with unknown validity,
3132 "X" for a good signature that has expired,
3133 "Y" for a good signature made by an expired key,
3134 "R" for a good signature made by a revoked key,
3135 "E" if the signature cannot be checked (e.g. missing key)
3136 and
"N" for no signature
3139 <dt class=
"hdlist1">
3144 show the name of the signer for a signed commit
3147 <dt class=
"hdlist1">
3152 show the key used to sign a signed commit
3155 <dt class=
"hdlist1">
3160 show the fingerprint of the key used to sign a signed commit
3163 <dt class=
"hdlist1">
3168 show the fingerprint of the primary key whose subkey was used
3169 to sign a signed commit
3172 <dt class=
"hdlist1">
3177 show the trust level for the key used to sign a signed commit
3180 <dt class=
"hdlist1">
3185 reflog selector, e.g.,
<code>refs/stash@{
1}
</code> or
<code>refs/stash@{
2
3186 minutes ago}
</code>; the format follows the rules described for the
3187 <code>-g
</code> option. The portion before the
<code>@
</code> is the refname as
3188 given on the command line (so
<code>git log -g refs/heads/master
</code>
3189 would yield
<code>refs/heads/master@{
0}
</code>).
3192 <dt class=
"hdlist1">
3197 shortened reflog selector; same as
<code>%gD
</code>, but the refname
3198 portion is shortened for human readability (so
3199 <code>refs/heads/master
</code> becomes just
<code>master
</code>).
3202 <dt class=
"hdlist1">
3207 reflog identity name
3210 <dt class=
"hdlist1">
3215 reflog identity name (respecting .mailmap, see
3216 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
3219 <dt class=
"hdlist1">
3224 reflog identity email
3227 <dt class=
"hdlist1">
3232 reflog identity email (respecting .mailmap, see
3233 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
3236 <dt class=
"hdlist1">
3244 <dt class=
"hdlist1">
3245 <em>%(trailers[:options])
</em>
3249 display the trailers of the body as
3251 <a href=
"git-interpret-trailers.html">git-interpret-trailers(
1)
</a>. The
3252 <code>trailers
</code> string may be followed by a colon
3253 and zero or more comma-separated options.
3254 If any option is provided multiple times the
3255 last occurrence wins.
3257 <div class=
"ulist"><ul>
3260 <em>key=
<key
></em>: only show trailers with specified
<key
>. Matching is done
3261 case-insensitively and trailing colon is optional. If option is
3262 given multiple times trailer lines matching any of the keys are
3263 shown. This option automatically enables the
<code>only
</code> option so that
3264 non-trailer lines in the trailer block are hidden. If that is not
3265 desired it can be disabled with
<code>only=false
</code>. E.g.,
3266 <code>%(trailers:key=Reviewed-by)
</code> shows trailer lines with key
3267 <code>Reviewed-by
</code>.
3272 <em>only[=
<bool
>]
</em>: select whether non-trailer lines from the trailer
3273 block should be included.
3278 <em>separator=
<sep
></em>: specify a separator inserted between trailer
3279 lines. When this option is not given each trailer line is
3280 terminated with a line feed character. The string
<sep
> may contain
3281 the literal formatting codes described above. To use comma as
3282 separator one must use
<code>%x2C
</code> as it would otherwise be parsed as
3283 next option. E.g.,
<code>%(trailers:key=Ticket,separator=%x2C )
</code>
3284 shows all trailer lines whose key is
"Ticket" separated by a comma
3290 <em>unfold[=
<bool
>]
</em>: make it behave as if interpret-trailer
’s
<code>--unfold
</code>
3291 option was given. E.g.,
3292 <code>%(trailers:only,unfold=true)
</code> unfolds and shows all trailer lines.
3297 <em>keyonly[=
<bool
>]
</em>: only show the key part of the trailer.
3302 <em>valueonly[=
<bool
>]
</em>: only show the value part of the trailer.
3307 <em>key_value_separator=
<sep
></em>: specify a separator inserted between
3308 trailer lines. When this option is not given each trailer key-value
3309 pair is separated by
": ". Otherwise it shares the same semantics
3310 as
<em>separator=
<sep
></em> above.
3320 <div class=
"admonitionblock">
3323 <div class=
"title">Note
</div>
3325 <td class=
"content">Some placeholders may depend on other options given to the
3326 revision traversal engine. For example, the
<code>%g*
</code> reflog options will
3327 insert an empty string unless we are traversing reflog entries (e.g., by
3328 <code>git log -g
</code>). The
<code>%d
</code> and
<code>%D
</code> placeholders will use the
"short"
3329 decoration format if
<code>--decorate
</code> was not already provided on the command
3333 <div class=
"paragraph"><p>The boolean options accept an optional value
<code>[=
<bool-value
>]
</code>. The values
3334 <code>true
</code>,
<code>false
</code>,
<code>on
</code>,
<code>off
</code> etc. are all accepted. See the
"boolean"
3335 sub-section in
"EXAMPLES" in
<a href=
"git-config.html">git-config(
1)
</a>. If a boolean
3336 option is given with no value, it
’s enabled.
</p></div>
3337 <div class=
"paragraph"><p>If you add a
<code>+
</code> (plus sign) after
<em>%
</em> of a placeholder, a line-feed
3338 is inserted immediately before the expansion if and only if the
3339 placeholder expands to a non-empty string.
</p></div>
3340 <div class=
"paragraph"><p>If you add a
<code>-
</code> (minus sign) after
<em>%
</em> of a placeholder, all consecutive
3341 line-feeds immediately preceding the expansion are deleted if and only if the
3342 placeholder expands to an empty string.
</p></div>
3343 <div class=
"paragraph"><p>If you add a ` ` (space) after
<em>%
</em> of a placeholder, a space
3344 is inserted immediately before the expansion if and only if the
3345 placeholder expands to a non-empty string.
</p></div>
3346 <div class=
"ulist"><ul>
3351 <div class=
"paragraph"><p>The
<em>tformat:
</em> format works exactly like
<em>format:
</em>, except that it
3352 provides
"terminator" semantics instead of
"separator" semantics. In
3353 other words, each commit has the message terminator character (usually a
3354 newline) appended, rather than a separator placed between entries.
3355 This means that the final entry of a single-line format will be properly
3356 terminated with a new line, just as the
"oneline" format does.
3357 For example:
</p></div>
3358 <div class=
"listingblock">
3359 <div class=
"content">
3360 <pre><code>$ git log -
2 --pretty=format:%h
4da45bef \
3361 | perl -pe '$_ .=
" -- NO NEWLINE\n" unless /\n/'
3363 7134973 -- NO NEWLINE
3365 $ git log -
2 --pretty=tformat:%h
4da45bef \
3366 | perl -pe '$_ .=
" -- NO NEWLINE\n" unless /\n/'
3368 7134973</code></pre>
3370 <div class=
"paragraph"><p>In addition, any unrecognized string that has a
<code>%
</code> in it is interpreted
3371 as if it has
<code>tformat:
</code> in front of it. For example, these two are
3372 equivalent:
</p></div>
3373 <div class=
"listingblock">
3374 <div class=
"content">
3375 <pre><code>$ git log -
2 --pretty=tformat:%h
4da45bef
3376 $ git log -
2 --pretty=%h
4da45bef
</code></pre>
3383 <h2 id=
"_raw_output_format">Raw output format
</h2>
3384 <div class=
"sectionbody">
3385 <div class=
"paragraph"><p>The raw output format from
"git-diff-index",
"git-diff-tree",
3386 "git-diff-files" and
"git diff --raw" are very similar.
</p></div>
3387 <div class=
"paragraph"><p>These commands all compare two sets of things; what is
3388 compared differs:
</p></div>
3389 <div class=
"dlist"><dl>
3390 <dt class=
"hdlist1">
3391 git-diff-index
<tree-ish
>
3395 compares the
<tree-ish
> and the files on the filesystem.
3398 <dt class=
"hdlist1">
3399 git-diff-index --cached
<tree-ish
>
3403 compares the
<tree-ish
> and the index.
3406 <dt class=
"hdlist1">
3407 git-diff-tree [-r]
<tree-ish-
1> <tree-ish-
2> [
<pattern
>…]
3411 compares the trees named by the two arguments.
3414 <dt class=
"hdlist1">
3415 git-diff-files [
<pattern
>…]
3419 compares the index and the files on the filesystem.
3423 <div class=
"paragraph"><p>The
"git-diff-tree" command begins its output by printing the hash of
3424 what is being compared. After that, all the commands print one output
3425 line per changed file.
</p></div>
3426 <div class=
"paragraph"><p>An output line is formatted this way:
</p></div>
3427 <div class=
"listingblock">
3428 <div class=
"content">
3429 <pre><code>in-place edit :
100644 100644 bcd1234
0123456 M file0
3430 copy-edit :
100644 100644 abcd123
1234567 C68 file1 file2
3431 rename-edit :
100644 100644 abcd123
1234567 R86 file1 file3
3432 create :
000000 100644 0000000 1234567 A file4
3433 delete :
100644 000000 1234567 0000000 D file5
3434 unmerged :
000000 000000 0000000 0000000 U file6
</code></pre>
3436 <div class=
"paragraph"><p>That is, from the left to the right:
</p></div>
3437 <div class=
"olist arabic"><ol class=
"arabic">
3445 mode for
"src";
000000 if creation or unmerged.
3455 mode for
"dst";
000000 if deletion or unmerged.
3465 sha1 for
"src";
0{
40} if creation or unmerged.
3475 sha1 for
"dst";
0{
40} if deletion, unmerged or
"work tree out of sync with the index".
3485 status, followed by optional
"score" number.
3490 a tab or a NUL when
<code>-z
</code> option is used.
3500 a tab or a NUL when
<code>-z
</code> option is used; only exists for C or R.
3505 path for
"dst"; only exists for C or R.
3510 an LF or a NUL when
<code>-z
</code> option is used, to terminate the record.
3514 <div class=
"paragraph"><p>Possible status letters are:
</p></div>
3515 <div class=
"ulist"><ul>
3518 A: addition of a file
3523 C: copy of a file into a new one
3528 D: deletion of a file
3533 M: modification of the contents or mode of a file
3538 R: renaming of a file
3543 T: change in the type of the file (regular file, symbolic link or submodule)
3548 U: file is unmerged (you must complete the merge before it can
3554 X:
"unknown" change type (most probably a bug, please report it)
3558 <div class=
"paragraph"><p>Status letters C and R are always followed by a score (denoting the
3559 percentage of similarity between the source and target of the move or
3560 copy). Status letter M may be followed by a score (denoting the
3561 percentage of dissimilarity) for file rewrites.
</p></div>
3562 <div class=
"paragraph"><p>The sha1 for
"dst" is shown as all
0’s if a file on the filesystem
3563 is out of sync with the index.
</p></div>
3564 <div class=
"paragraph"><p>Example:
</p></div>
3565 <div class=
"listingblock">
3566 <div class=
"content">
3567 <pre><code>:
100644 100644 5be4a4a
0000000 M file.c
</code></pre>
3569 <div class=
"paragraph"><p>Without the
<code>-z
</code> option, pathnames with
"unusual" characters are
3570 quoted as explained for the configuration variable
<code>core.quotePath
</code>
3571 (see
<a href=
"git-config.html">git-config(
1)
</a>). Using
<code>-z
</code> the filename is output
3572 verbatim and the line is terminated by a NUL byte.
</p></div>
3576 <h2 id=
"_diff_format_for_merges">diff format for merges
</h2>
3577 <div class=
"sectionbody">
3578 <div class=
"paragraph"><p>"git-diff-tree",
"git-diff-files" and
"git-diff --raw"
3579 can take
<code>-c
</code> or
<code>--cc
</code> option
3580 to generate diff output also for merge commits. The output differs
3581 from the format described above in the following way:
</p></div>
3582 <div class=
"olist arabic"><ol class=
"arabic">
3585 there is a colon for each parent
3590 there are more
"src" modes and
"src" sha1
3595 status is concatenated status characters for each parent
3600 no optional
"score" number
3605 tab-separated pathname(s) of the file
3609 <div class=
"paragraph"><p>For
<code>-c
</code> and
<code>--cc
</code>, only the destination or final path is shown even
3610 if the file was renamed on any side of history. With
3611 <code>--combined-all-paths
</code>, the name of the path in each parent is shown
3612 followed by the name of the path in the merge commit.
</p></div>
3613 <div class=
"paragraph"><p>Examples for
<code>-c
</code> and
<code>--cc
</code> without
<code>--combined-all-paths
</code>:
</p></div>
3614 <div class=
"listingblock">
3615 <div class=
"content">
3616 <pre><code>::
100644 100644 100644 fabadb8 cc95eb0
4866510 MM desc.c
3617 ::
100755 100755 100755 52b7a2d
6d1ac04 d2ac7d7 RM bar.sh
3618 ::
100644 100644 100644 e07d6c5
9042e82 ee91881 RR phooey.c
</code></pre>
3620 <div class=
"paragraph"><p>Examples when
<code>--combined-all-paths
</code> added to either
<code>-c
</code> or
<code>--cc
</code>:
</p></div>
3621 <div class=
"listingblock">
3622 <div class=
"content">
3623 <pre><code>::
100644 100644 100644 fabadb8 cc95eb0
4866510 MM desc.c desc.c desc.c
3624 ::
100755 100755 100755 52b7a2d
6d1ac04 d2ac7d7 RM foo.sh bar.sh bar.sh
3625 ::
100644 100644 100644 e07d6c5
9042e82 ee91881 RR fooey.c fuey.c phooey.c
</code></pre>
3627 <div class=
"paragraph"><p>Note that
<em>combined diff
</em> lists only files which were modified from
3628 all parents.
</p></div>
3632 <h2 id=
"generate_patch_text_with_p">Generating patch text with -p
</h2>
3633 <div class=
"sectionbody">
3634 <div class=
"paragraph"><p>Running
3635 <a href=
"git-diff.html">git-diff(
1)
</a>,
3636 <a href=
"git-log.html">git-log(
1)
</a>,
3637 <a href=
"git-show.html">git-show(
1)
</a>,
3638 <a href=
"git-diff-index.html">git-diff-index(
1)
</a>,
3639 <a href=
"git-diff-tree.html">git-diff-tree(
1)
</a>, or
3640 <a href=
"git-diff-files.html">git-diff-files(
1)
</a>
3641 with the
<code>-p
</code> option produces patch text.
3642 You can customize the creation of patch text via the
3643 <code>GIT_EXTERNAL_DIFF
</code> and the
<code>GIT_DIFF_OPTS
</code> environment variables
3644 (see
<a href=
"git.html">git(
1)
</a>), and the
<code>diff
</code> attribute (see
<a href=
"gitattributes.html">gitattributes(
5)
</a>).
</p></div>
3645 <div class=
"paragraph"><p>What the -p option produces is slightly different from the traditional
3646 diff format:
</p></div>
3647 <div class=
"olist arabic"><ol class=
"arabic">
3650 It is preceded with a
"git diff" header that looks like this:
3652 <div class=
"literalblock">
3653 <div class=
"content">
3654 <pre><code>diff --git a/file1 b/file2
</code></pre>
3656 <div class=
"paragraph"><p>The
<code>a/
</code> and
<code>b/
</code> filenames are the same unless rename/copy is
3657 involved. Especially, even for a creation or a deletion,
3658 <code>/dev/null
</code> is
<em>not
</em> used in place of the
<code>a/
</code> or
<code>b/
</code> filenames.
</p></div>
3659 <div class=
"paragraph"><p>When rename/copy is involved,
<code>file1
</code> and
<code>file2
</code> show the
3660 name of the source file of the rename/copy and the name of
3661 the file that rename/copy produces, respectively.
</p></div>
3665 It is followed by one or more extended header lines:
3667 <div class=
"literalblock">
3668 <div class=
"content">
3669 <pre><code>old mode
<mode
>
3670 new mode
<mode
>
3671 deleted file mode
<mode
>
3672 new file mode
<mode
>
3673 copy from
<path
>
3674 copy to
<path
>
3675 rename from
<path
>
3676 rename to
<path
>
3677 similarity index
<number
>
3678 dissimilarity index
<number
>
3679 index
<hash
>..
<hash
> <mode
></code></pre>
3681 <div class=
"paragraph"><p>File modes are printed as
6-digit octal numbers including the file type
3682 and file permission bits.
</p></div>
3683 <div class=
"paragraph"><p>Path names in extended headers do not include the
<code>a/
</code> and
<code>b/
</code> prefixes.
</p></div>
3684 <div class=
"paragraph"><p>The similarity index is the percentage of unchanged lines, and
3685 the dissimilarity index is the percentage of changed lines. It
3686 is a rounded down integer, followed by a percent sign. The
3687 similarity index value of
100% is thus reserved for two equal
3688 files, while
100% dissimilarity means that no line from the old
3689 file made it into the new one.
</p></div>
3690 <div class=
"paragraph"><p>The index line includes the blob object names before and after the change.
3691 The
<mode
> is included if the file mode does not change; otherwise,
3692 separate lines indicate the old and the new mode.
</p></div>
3696 Pathnames with
"unusual" characters are quoted as explained for
3697 the configuration variable
<code>core.quotePath
</code> (see
3698 <a href=
"git-config.html">git-config(
1)
</a>).
3703 All the
<code>file1
</code> files in the output refer to files before the
3704 commit, and all the
<code>file2
</code> files refer to files after the commit.
3705 It is incorrect to apply each change to each file sequentially. For
3706 example, this patch will swap a and b:
3708 <div class=
"literalblock">
3709 <div class=
"content">
3710 <pre><code>diff --git a/a b/b
3715 rename to a
</code></pre>
3720 Hunk headers mention the name of the function to which the hunk
3721 applies. See
"Defining a custom hunk-header" in
3722 <a href=
"gitattributes.html">gitattributes(
5)
</a> for details of how to tailor to this to
3730 <h2 id=
"_combined_diff_format">Combined diff format
</h2>
3731 <div class=
"sectionbody">
3732 <div class=
"paragraph"><p>Any diff-generating command can take the
<code>-c
</code> or
<code>--cc
</code> option to
3733 produce a
<em>combined diff
</em> when showing a merge. This is the default
3734 format when showing merges with
<a href=
"git-diff.html">git-diff(
1)
</a> or
3735 <a href=
"git-show.html">git-show(
1)
</a>. Note also that you can give suitable
3736 <code>--diff-merges
</code> option to any of these commands to force generation of
3737 diffs in specific format.
</p></div>
3738 <div class=
"paragraph"><p>A
"combined diff" format looks like this:
</p></div>
3739 <div class=
"listingblock">
3740 <div class=
"content">
3741 <pre><code>diff --combined describe.c
3742 index fabadb8,cc95eb0.
.4866510
3745 @@@ -
98,
20 -
98,
12 +
98,
20 @@@
3746 return (a_date
> b_date) ? -
1 : (a_date == b_date) ?
0 :
1;
3749 - static void describe(char *arg)
3750 -static void describe(struct commit *cmit, int last_one)
3751 ++static void describe(char *arg, int last_one)
3753 + unsigned char sha1[
20];
3754 + struct commit *cmit;
3755 struct commit_list *list;
3756 static int initialized =
0;
3757 struct commit_name *n;
3759 + if (get_sha1(arg, sha1)
< 0)
3760 + usage(describe_usage);
3761 + cmit = lookup_commit_reference(sha1);
3763 + usage(describe_usage);
3767 for_each_ref(get_name);
</code></pre>
3769 <div class=
"olist arabic"><ol class=
"arabic">
3772 It is preceded with a
"git diff" header, that looks like
3773 this (when the
<code>-c
</code> option is used):
3775 <div class=
"literalblock">
3776 <div class=
"content">
3777 <pre><code>diff --combined file
</code></pre>
3779 <div class=
"paragraph"><p>or like this (when the
<code>--cc
</code> option is used):
</p></div>
3780 <div class=
"literalblock">
3781 <div class=
"content">
3782 <pre><code>diff --cc file
</code></pre>
3787 It is followed by one or more extended header lines
3788 (this example shows a merge with two parents):
3790 <div class=
"literalblock">
3791 <div class=
"content">
3792 <pre><code>index
<hash
>,
<hash
>..
<hash
>
3793 mode
<mode
>,
<mode
>..
<mode
>
3794 new file mode
<mode
>
3795 deleted file mode
<mode
>,
<mode
></code></pre>
3797 <div class=
"paragraph"><p>The
<code>mode
<mode
>,
<mode
>..
<mode
></code> line appears only if at least one of
3798 the
<mode
> is different from the rest. Extended headers with
3799 information about detected contents movement (renames and
3800 copying detection) are designed to work with diff of two
3801 <tree-ish
> and are not used by combined diff format.
</p></div>
3805 It is followed by two-line from-file/to-file header
3807 <div class=
"literalblock">
3808 <div class=
"content">
3809 <pre><code>--- a/file
3810 +++ b/file
</code></pre>
3812 <div class=
"paragraph"><p>Similar to two-line header for traditional
<em>unified
</em> diff
3813 format,
<code>/dev/null
</code> is used to signal created or deleted
3815 <div class=
"paragraph"><p>However, if the --combined-all-paths option is provided, instead of a
3816 two-line from-file/to-file you get a N+
1 line from-file/to-file header,
3817 where N is the number of parents in the merge commit
</p></div>
3818 <div class=
"literalblock">
3819 <div class=
"content">
3820 <pre><code>--- a/file
3823 +++ b/file
</code></pre>
3825 <div class=
"paragraph"><p>This extended format can be useful if rename or copy detection is
3826 active, to allow you to see the original name of the file in different
3831 Chunk header format is modified to prevent people from
3832 accidentally feeding it to
<code>patch -p1
</code>. Combined diff format
3833 was created for review of merge commit changes, and was not
3834 meant to be applied. The change is similar to the change in the
3835 extended
<em>index
</em> header:
3837 <div class=
"literalblock">
3838 <div class=
"content">
3839 <pre><code>@@@
<from-file-range
> <from-file-range
> <to-file-range
> @@@
</code></pre>
3841 <div class=
"paragraph"><p>There are (number of parents +
1)
<code>@
</code> characters in the chunk
3842 header for combined diff format.
</p></div>
3845 <div class=
"paragraph"><p>Unlike the traditional
<em>unified
</em> diff format, which shows two
3846 files A and B with a single column that has
<code>-
</code> (minus
 — appears in A but removed in B),
<code>+
</code> (plus
 — missing in A but
3847 added to B), or
<code>" "</code> (space
 — unchanged) prefix, this format
3848 compares two or more files file1, file2,
… with one file X, and
3849 shows how X differs from each of fileN. One column for each of
3850 fileN is prepended to the output line to note how X
’s line is
3851 different from it.
</p></div>
3852 <div class=
"paragraph"><p>A
<code>-
</code> character in the column N means that the line appears in
3853 fileN but it does not appear in the result. A
<code>+
</code> character
3854 in the column N means that the line appears in the result,
3855 and fileN does not have that line (in other words, the line was
3856 added, from the point of view of that parent).
</p></div>
3857 <div class=
"paragraph"><p>In the above example output, the function signature was changed
3858 from both files (hence two
<code>-
</code> removals from both file1 and
3859 file2, plus
<code>++
</code> to mean one line that was added does not appear
3860 in either file1 or file2). Also eight other lines are the same
3861 from file1 but do not appear in file2 (hence prefixed with
<code>+
</code>).
</p></div>
3862 <div class=
"paragraph"><p>When shown by
<code>git diff-tree -c
</code>, it compares the parents of a
3863 merge commit with the merge result (i.e. file1..fileN are the
3864 parents). When shown by
<code>git diff-files -c
</code>, it compares the
3865 two unresolved merge parents with the working tree file
3866 (i.e. file1 is stage
2 aka
"our version", file2 is stage
3 aka
3867 "their version").
</p></div>
3871 <h2 id=
"_other_diff_formats">other diff formats
</h2>
3872 <div class=
"sectionbody">
3873 <div class=
"paragraph"><p>The
<code>--summary
</code> option describes newly added, deleted, renamed and
3874 copied files. The
<code>--stat
</code> option adds diffstat(
1) graph to the
3875 output. These options can be combined with other options, such as
3876 <code>-p
</code>, and are meant for human consumption.
</p></div>
3877 <div class=
"paragraph"><p>When showing a change that involves a rename or a copy,
<code>--stat
</code> output
3878 formats the pathnames compactly by combining common prefix and suffix of
3879 the pathnames. For example, a change that moves
<code>arch/i386/Makefile
</code> to
3880 <code>arch/x86/Makefile
</code> while modifying
4 lines will be shown like this:
</p></div>
3881 <div class=
"listingblock">
3882 <div class=
"content">
3883 <pre><code>arch/{i386 =
> x86}/Makefile |
4 +--
</code></pre>
3885 <div class=
"paragraph"><p>The
<code>--numstat
</code> option gives the diffstat(
1) information but is designed
3886 for easier machine consumption. An entry in
<code>--numstat
</code> output looks
3887 like this:
</p></div>
3888 <div class=
"listingblock">
3889 <div class=
"content">
3890 <pre><code>1 2 README
3891 3 1 arch/{i386 =
> x86}/Makefile
</code></pre>
3893 <div class=
"paragraph"><p>That is, from left to right:
</p></div>
3894 <div class=
"olist arabic"><ol class=
"arabic">
3897 the number of added lines;
3907 the number of deleted lines;
3917 pathname (possibly with rename/copy information);
3926 <div class=
"paragraph"><p>When
<code>-z
</code> output option is in effect, the output is formatted this way:
</p></div>
3927 <div class=
"listingblock">
3928 <div class=
"content">
3929 <pre><code>1 2 README NUL
3930 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL
</code></pre>
3932 <div class=
"paragraph"><p>That is:
</p></div>
3933 <div class=
"olist arabic"><ol class=
"arabic">
3936 the number of added lines;
3946 the number of deleted lines;
3956 a NUL (only exists if renamed/copied);
3961 pathname in preimage;
3966 a NUL (only exists if renamed/copied);
3971 pathname in postimage (only exists if renamed/copied);
3980 <div class=
"paragraph"><p>The extra
<code>NUL
</code> before the preimage path in renamed case is to allow
3981 scripts that read the output to tell if the current record being read is
3982 a single-path record or a rename/copy record without reading ahead.
3983 After reading added and deleted lines, reading up to
<code>NUL
</code> would yield
3984 the pathname, but if that is
<code>NUL
</code>, the record will show two paths.
</p></div>
3988 <h2 id=
"_git">GIT
</h2>
3989 <div class=
"sectionbody">
3990 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
3994 <div id=
"footnotes"><hr /></div>
3996 <div id=
"footer-text">
3998 2021-
12-
10 14:
52:
02 PST