blob: 1c80df8d420773a40790232931e1bad10970c893 [file] [log] [blame]
Junio C Hamanob96f40a2024-08-01 00:57:251<!DOCTYPE html>
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3<head>
4<meta charset="UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
Junio C Hamanod6a33e42025-02-18 23:45:117<meta name="generator" content="Asciidoctor 2.0.23"/>
Junio C Hamanob96f40a2024-08-01 00:57:258<title>git-show(1)</title>
9<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
10<style>
11/*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
12/* Uncomment the following line when using as a custom stylesheet */
13/* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */
14html{font-family:sans-serif;-webkit-text-size-adjust:100%}
15a{background:none}
16a:focus{outline:thin dotted}
17a:active,a:hover{outline:0}
18h1{font-size:2em;margin:.67em 0}
19b,strong{font-weight:bold}
20abbr{font-size:.9em}
21abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none}
22dfn{font-style:italic}
23hr{height:0}
24mark{background:#ff0;color:#000}
25code,kbd,pre,samp{font-family:monospace;font-size:1em}
26pre{white-space:pre-wrap}
27q{quotes:"\201C" "\201D" "\2018" "\2019"}
28small{font-size:80%}
29sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
30sup{top:-.5em}
31sub{bottom:-.25em}
32img{border:0}
33svg:not(:root){overflow:hidden}
34figure{margin:0}
35audio,video{display:inline-block}
36audio:not([controls]){display:none;height:0}
37fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
38legend{border:0;padding:0}
39button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
40button,input{line-height:normal}
41button,select{text-transform:none}
42button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43button[disabled],html input[disabled]{cursor:default}
44input[type=checkbox],input[type=radio]{padding:0}
45button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
46textarea{overflow:auto;vertical-align:top}
47table{border-collapse:collapse;border-spacing:0}
48*,::before,::after{box-sizing:border-box}
49html,body{font-size:100%}
50body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
51a:hover{cursor:pointer}
52img,object,embed{max-width:100%;height:auto}
53object,embed{height:100%}
54img{-ms-interpolation-mode:bicubic}
55.left{float:left!important}
56.right{float:right!important}
57.text-left{text-align:left!important}
58.text-right{text-align:right!important}
59.text-center{text-align:center!important}
60.text-justify{text-align:justify!important}
61.hide{display:none}
62img,object,svg{display:inline-block;vertical-align:middle}
63textarea{height:auto;min-height:50px}
64select{width:100%}
65.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
66div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}
67a{color:#2156a5;text-decoration:underline;line-height:inherit}
68a:hover,a:focus{color:#1d4b8f}
69a img{border:0}
70p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
71p aside{font-size:.875em;line-height:1.35;font-style:italic}
72h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
73h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
74h1{font-size:2.125em}
75h2{font-size:1.6875em}
76h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
77h4,h5{font-size:1.125em}
78h6{font-size:1em}
79hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em}
80em,i{font-style:italic;line-height:inherit}
81strong,b{font-weight:bold;line-height:inherit}
82small{font-size:60%;line-height:inherit}
83code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
84ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
85ul,ol{margin-left:1.5em}
86ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
87ul.circle{list-style-type:circle}
88ul.disc{list-style-type:disc}
89ul.square{list-style-type:square}
90ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
92dl dt{margin-bottom:.3125em;font-weight:bold}
93dl dd{margin-bottom:1.25em}
94blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
95blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
96@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
97h1{font-size:2.75em}
98h2{font-size:2.3125em}
99h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
100h4{font-size:1.4375em}}
101table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal}
102table thead,table tfoot{background:#f7f8f7}
103table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
104table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
105table tr.even,table tr.alt{background:#f8f8f7}
106table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6}
107h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
108h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
109.center{margin-left:auto;margin-right:auto}
110.stretch{width:100%}
111.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
112.clearfix::after,.float-group::after{clear:both}
113:not(pre).nobreak{word-wrap:normal}
114:not(pre).nowrap{white-space:nowrap}
115:not(pre).pre-wrap{white-space:pre-wrap}
116:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
117pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
118pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119pre>code{display:block}
120pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121em em{font-style:normal}
122strong strong{font-weight:400}
123.keyseq{color:rgba(51,51,51,.8)}
124kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
125.keyseq kbd:first-child{margin-left:0}
126.keyseq kbd:last-child{margin-right:0}
127.menuseq,.menuref{color:#000}
128.menuseq b:not(.caret),.menuref{font-weight:inherit}
129.menuseq{word-spacing:-.02em}
130.menuseq b.caret{font-size:1.25em;line-height:.8}
131.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
132b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
133b.button::before{content:"[";padding:0 3px 0 2px}
134b.button::after{content:"]";padding:0 2px 0 3px}
135p a>code:hover{color:rgba(0,0,0,.9)}
136#header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
137#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
138#header::after,#content::after,#footnotes::after,#footer::after{clear:both}
139#content{margin-top:1.25em}
140#content::before{content:none}
141#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
142#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
Junio C Hamanod6a33e42025-02-18 23:45:11143#header>h1:only-child{border-bottom:1px solid #dddddf;padding-bottom:8px}
Junio C Hamanob96f40a2024-08-01 00:57:25144#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
145#header .details span:first-child{margin-left:-.125em}
146#header .details span.email a{color:rgba(0,0,0,.85)}
147#header .details br{display:none}
148#header .details br+span::before{content:"\00a0\2013\00a0"}
149#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
150#header .details br+span#revremark::before{content:"\00a0|\00a0"}
151#header #revnumber{text-transform:capitalize}
152#header #revnumber::after{content:"\00a0"}
153#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
154#toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
155#toc>ul{margin-left:.125em}
156#toc ul.sectlevel0>li>a{font-style:italic}
157#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
158#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
159#toc li{line-height:1.3334;margin-top:.3334em}
160#toc a{text-decoration:none}
161#toc a:active{text-decoration:underline}
162#toctitle{color:#7a2518;font-size:1.2em}
163@media screen and (min-width:768px){#toctitle{font-size:1.375em}
164body.toc2{padding-left:15em;padding-right:0}
Junio C Hamanod6a33e42025-02-18 23:45:11165body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
Junio C Hamanob96f40a2024-08-01 00:57:25166#toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
167#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
168#toc.toc2>ul{font-size:.9em;margin-bottom:0}
169#toc.toc2 ul ul{margin-left:0;padding-left:1em}
170#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
171body.toc2.toc-right{padding-left:0;padding-right:15em}
172body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
173@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
174#toc.toc2{width:20em}
175#toc.toc2 #toctitle{font-size:1.375em}
176#toc.toc2>ul{font-size:.95em}
177#toc.toc2 ul ul{padding-left:1.25em}
178body.toc2.toc-right{padding-left:0;padding-right:20em}}
179#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px}
180#content #toc>:first-child{margin-top:0}
181#content #toc>:last-child{margin-bottom:0}
182#footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em}
183#footer-text{color:hsla(0,0%,100%,.8);line-height:1.44}
184#content{margin-bottom:.625em}
185.sect1{padding-bottom:.625em}
186@media screen and (min-width:768px){#content{margin-bottom:1.25em}
187.sect1{padding-bottom:1.25em}}
188.sect1:last-child{padding-bottom:0}
189.sect1+.sect1{border-top:1px solid #e7e7e9}
190#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
191#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
192#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
193#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
194#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
195details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
196details{margin-left:1.25rem}
197details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent}
198details>summary::-webkit-details-marker{display:none}
199details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)}
200details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)}
201details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem}
202.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
203table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
204.paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
205.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
206.admonitionblock>table td.icon{text-align:center;width:80px}
207.admonitionblock>table td.icon img{max-width:none}
208.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
209.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
210.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
211.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
212.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
213.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
214.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
215.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
216.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
217@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
218@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
219.literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
220.literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
221.listingblock>.content{position:relative}
222.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
223.listingblock:hover code[data-lang]::before{display:block}
224.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
225.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
226.listingblock pre.highlightjs{padding:0}
227.listingblock pre.highlightjs>code{padding:1em;border-radius:4px}
228.listingblock pre.prettyprint{border-width:0}
229.prettyprint{background:#f7f7f8}
230pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
231pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
232pre.prettyprint li code[data-lang]::before{opacity:1}
233pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
234table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
235table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
236table.linenotable td.code{padding-left:.75em}
237table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
238pre.pygments span.linenos{display:inline-block;margin-right:.75em}
239.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
240.quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
241.quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
242.quoteblock blockquote{margin:0;padding:0;border:0}
243.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
244.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
245.quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
246.verseblock{margin:0 1em 1.25em}
247.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
248.verseblock pre strong{font-weight:400}
249.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
250.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
251.quoteblock .attribution br,.verseblock .attribution br{display:none}
252.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
253.quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
254.quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
255.quoteblock.abstract{margin:0 1em 1.25em;display:block}
256.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
257.quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
258.quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
259.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
260.quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0}
261p.tableblock:last-child{margin-bottom:0}
262td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere}
263td.tableblock>.content>:last-child{margin-bottom:-1.25em}
264table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
265table.grid-all>*>tr>*{border-width:1px}
266table.grid-cols>*>tr>*{border-width:0 1px}
267table.grid-rows>*>tr>*{border-width:1px 0}
268table.frame-all{border-width:1px}
269table.frame-ends{border-width:1px 0}
270table.frame-sides{border-width:0 1px}
271table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0}
272table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0}
273table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0}
274table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0}
275table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7}
276th.halign-left,td.halign-left{text-align:left}
277th.halign-right,td.halign-right{text-align:right}
278th.halign-center,td.halign-center{text-align:center}
279th.valign-top,td.valign-top{vertical-align:top}
280th.valign-bottom,td.valign-bottom{vertical-align:bottom}
281th.valign-middle,td.valign-middle{vertical-align:middle}
282table thead th,table tfoot th{font-weight:bold}
283tbody tr th{background:#f7f8f7}
284tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
285p.tableblock>code:only-child{background:none;padding:0}
286p.tableblock{font-size:1em}
287ol{margin-left:1.75em}
288ul li ol{margin-left:1.5em}
289dl dd{margin-left:1.125em}
290dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
291li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
292ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
293ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
294ul.unstyled,ol.unstyled{margin-left:0}
295li>p:empty:only-child::before{content:"";display:inline-block}
296ul.checklist>li>p:first-child{margin-left:-1em}
297ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
298ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em}
299ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
300ul.inline>li{margin-left:1.25em}
301.unstyled dl dt{font-weight:400;font-style:normal}
302ol.arabic{list-style-type:decimal}
303ol.decimal{list-style-type:decimal-leading-zero}
304ol.loweralpha{list-style-type:lower-alpha}
305ol.upperalpha{list-style-type:upper-alpha}
306ol.lowerroman{list-style-type:lower-roman}
307ol.upperroman{list-style-type:upper-roman}
308ol.lowergreek{list-style-type:lower-greek}
309.hdlist>table,.colist>table{border:0;background:none}
310.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
311td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
312td.hdlist1{font-weight:bold;padding-bottom:1.25em}
313td.hdlist2{word-wrap:anywhere}
314.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
315.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
316.colist td:not([class]):first-child img{max-width:none}
317.colist td:not([class]):last-child{padding:.25em 0}
318.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd}
319.imageblock.left{margin:.25em .625em 1.25em 0}
320.imageblock.right{margin:.25em 0 1.25em .625em}
321.imageblock>.title{margin-bottom:0}
322.imageblock.thumb,.imageblock.th{border-width:6px}
323.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
324.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
325.image.left{margin-right:.625em}
326.image.right{margin-left:.625em}
327a.image{text-decoration:none;display:inline-block}
328a.image object{pointer-events:none}
329sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
330sup.footnote a,sup.footnoteref a{text-decoration:none}
Junio C Hamanod6a33e42025-02-18 23:45:11331sup.footnote a:active,sup.footnoteref a:active,#footnotes .footnote a:first-of-type:active{text-decoration:underline}
Junio C Hamanob96f40a2024-08-01 00:57:25332#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
333#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
334#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
335#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
336#footnotes .footnote:last-of-type{margin-bottom:0}
337#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
338div.unbreakable{page-break-inside:avoid}
339.big{font-size:larger}
340.small{font-size:smaller}
341.underline{text-decoration:underline}
342.overline{text-decoration:overline}
343.line-through{text-decoration:line-through}
344.aqua{color:#00bfbf}
345.aqua-background{background:#00fafa}
346.black{color:#000}
347.black-background{background:#000}
348.blue{color:#0000bf}
349.blue-background{background:#0000fa}
350.fuchsia{color:#bf00bf}
351.fuchsia-background{background:#fa00fa}
352.gray{color:#606060}
353.gray-background{background:#7d7d7d}
354.green{color:#006000}
355.green-background{background:#007d00}
356.lime{color:#00bf00}
357.lime-background{background:#00fa00}
358.maroon{color:#600000}
359.maroon-background{background:#7d0000}
360.navy{color:#000060}
361.navy-background{background:#00007d}
362.olive{color:#606000}
363.olive-background{background:#7d7d00}
364.purple{color:#600060}
365.purple-background{background:#7d007d}
366.red{color:#bf0000}
367.red-background{background:#fa0000}
368.silver{color:#909090}
369.silver-background{background:#bcbcbc}
370.teal{color:#006060}
371.teal-background{background:#007d7d}
372.white{color:#bfbfbf}
373.white-background{background:#fafafa}
374.yellow{color:#bfbf00}
375.yellow-background{background:#fafa00}
376span.icon>.fa{cursor:default}
377a span.icon>.fa{cursor:inherit}
378.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
379.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
380.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
381.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
382.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
383.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
384.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
385.conum[data-value] *{color:#fff!important}
386.conum[data-value]+b{display:none}
387.conum[data-value]::after{content:attr(data-value)}
388pre .conum[data-value]{position:relative;top:-.125em}
389b.conum *{color:inherit!important}
390.conum:not([data-value]):empty{display:none}
391dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
392h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
393p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
394p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
395p{margin-bottom:1.25rem}
396.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
397.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
398.print-only{display:none!important}
399@page{margin:1.25cm .75cm}
400@media print{*{box-shadow:none!important;text-shadow:none!important}
401html{font-size:80%}
402a{color:inherit!important;text-decoration:underline!important}
403a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
404a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
405abbr[title]{border-bottom:1px dotted}
406abbr[title]::after{content:" (" attr(title) ")"}
407pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
408thead{display:table-header-group}
409svg{max-width:100%}
410p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
411h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
412#header,#content,#footnotes,#footer{max-width:none}
413#toc,.sidebarblock,.exampleblock>.content{background:none!important}
414#toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
415body.book #header{text-align:center}
416body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
417body.book #header .details{border:0!important;display:block;padding:0!important}
418body.book #header .details span:first-child{margin-left:0!important}
419body.book #header .details br{display:block}
420body.book #header .details br+span::before{content:none!important}
421body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
422body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
423.listingblock code[data-lang]::before{display:block}
424#footer{padding:0 .9375em}
425.hide-on-print{display:none!important}
426.print-only{display:block!important}
427.hide-for-print{display:none!important}
428.show-for-print{display:inherit!important}}
429@media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem}
430.sect1{padding:0!important}
431.sect1+.sect1{border:0}
432#footer{background:none}
433#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
434@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
435</style>
436<style>
437pre>code {
438 display: inline;
439}
440</style>
441</head>
442<body class="manpage">
443<div id="header">
444<h1>git-show(1) Manual Page</h1>
445<h2 id="_name">NAME</h2>
446<div class="sectionbody">
447<p>git-show - Show various types of objects</p>
448</div>
449</div>
450<div id="content">
451<div class="sect1">
452<h2 id="_synopsis">SYNOPSIS</h2>
453<div class="sectionbody">
454<div class="verseblock">
455<pre class="content"><em>git show</em> [&lt;options&gt;] [&lt;object&gt;&#8230;&#8203;]</pre>
456</div>
457</div>
458</div>
459<div class="sect1">
460<h2 id="_description">DESCRIPTION</h2>
461<div class="sectionbody">
462<div class="paragraph">
463<p>Shows one or more objects (blobs, trees, tags and commits).</p>
464</div>
465<div class="paragraph">
466<p>For commits it shows the log message and textual diff. It also
467presents the merge commit in a special format as produced by
468<em>git diff-tree --cc</em>.</p>
469</div>
470<div class="paragraph">
471<p>For tags, it shows the tag message and the referenced objects.</p>
472</div>
473<div class="paragraph">
474<p>For trees, it shows the names (equivalent to <em>git ls-tree</em>
475with --name-only).</p>
476</div>
477<div class="paragraph">
478<p>For plain blobs, it shows the plain contents.</p>
479</div>
480<div class="paragraph">
481<p>Some options that <em>git log</em> command understands can be used to
482control how the changes the commit introduces are shown.</p>
483</div>
484<div class="paragraph">
485<p>This manual page describes only the most frequently used options.</p>
486</div>
487</div>
488</div>
489<div class="sect1">
490<h2 id="_options">OPTIONS</h2>
491<div class="sectionbody">
492<div class="dlist">
493<dl>
494<dt class="hdlist1">&lt;object&gt;&#8230;&#8203;</dt>
495<dd>
496<p>The names of objects to show (defaults to <em>HEAD</em>).
497For a more complete list of ways to spell object names, see
498"SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>.</p>
499</dd>
500<dt class="hdlist1">--pretty[=&lt;format&gt;]</dt>
501<dt class="hdlist1">--format=&lt;format&gt;</dt>
502<dd>
503<p>Pretty-print the contents of the commit logs in a given format,
504where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
505<em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
506and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
507and has <em>%placeholder</em> in it, it acts as if
508<em>--pretty=tformat:&lt;format&gt;</em> were given.</p>
509<div class="paragraph">
510<p>See the "PRETTY FORMATS" section for some additional details for each
511format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p>
512</div>
513<div class="paragraph">
514<p>Note: you can specify the default pretty format in the repository
515configuration (see <a href="git-config.html">git-config(1)</a>).</p>
516</div>
517</dd>
518<dt class="hdlist1">--abbrev-commit</dt>
519<dd>
520<p>Instead of showing the full 40-byte hexadecimal commit object
521name, show a prefix that names the object uniquely.
522"--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
523option can be used to specify the minimum length of the prefix.</p>
524<div class="paragraph">
525<p>This should make "--pretty=oneline" a whole lot more readable for
526people using 80-column terminals.</p>
527</div>
528</dd>
529<dt class="hdlist1">--no-abbrev-commit</dt>
530<dd>
531<p>Show the full 40-byte hexadecimal commit object name. This negates
532<code>--abbrev-commit</code>, either explicit or implied by other options such
533as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.</p>
534</dd>
535<dt class="hdlist1">--oneline</dt>
536<dd>
537<p>This is a shorthand for "--pretty=oneline --abbrev-commit"
538used together.</p>
539</dd>
540<dt class="hdlist1">--encoding=&lt;encoding&gt;</dt>
541<dd>
542<p>Commit objects record the character encoding used for the log message
543in their encoding header; this option can be used to tell the
544command to re-code the commit log message in the encoding
545preferred by the user. For non plumbing commands this
546defaults to UTF-8. Note that if an object claims to be encoded
547in <code>X</code> and we are outputting in <code>X</code>, we will output the object
548verbatim; this means that invalid sequences in the original
549commit may be copied to the output. Likewise, if iconv(3) fails
550to convert the commit, we will quietly output the original
551object verbatim.</p>
552</dd>
553<dt class="hdlist1">--expand-tabs=&lt;n&gt;</dt>
554<dt class="hdlist1">--expand-tabs</dt>
555<dt class="hdlist1">--no-expand-tabs</dt>
556<dd>
557<p>Perform a tab expansion (replace each tab with enough spaces
558to fill to the next display column that is a multiple of <em>&lt;n&gt;</em>)
559in the log message before showing it in the output.
560<code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
561<code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
562which disables tab expansion.</p>
563<div class="paragraph">
564<p>By default, tabs are expanded in pretty formats that indent the log
565message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
566and <em>fuller</em>).</p>
567</div>
568</dd>
569<dt class="hdlist1">--notes[=&lt;ref&gt;]</dt>
570<dd>
571<p>Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
572commit, when showing the commit log message. This is the default
Junio C Hamanodc392382024-10-11 18:57:29573for <code>git</code> <code>log</code>, <code>git</code> <code>show</code> and <code>git</code> <code>whatchanged</code> commands when
Junio C Hamanob96f40a2024-08-01 00:57:25574there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
575on the command line.</p>
576<div class="paragraph">
577<p>By default, the notes shown are from the notes refs listed in the
578<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
579environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p>
580</div>
581<div class="paragraph">
582<p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
583to display. The ref can specify the full refname when it begins
584with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
585<code>refs/notes/</code> is prefixed to form the full name of the ref.</p>
586</div>
587<div class="paragraph">
588<p>Multiple --notes options can be combined to control which notes are
589being displayed. Examples: "--notes=foo" will show only notes from
590"refs/notes/foo"; "--notes=foo --notes" will show both notes from
591"refs/notes/foo" and from the default notes ref(s).</p>
592</div>
593</dd>
594<dt class="hdlist1">--no-notes</dt>
595<dd>
596<p>Do not show notes. This negates the above <code>--notes</code> option, by
597resetting the list of notes refs from which notes are shown.
598Options are parsed in the order given on the command line, so e.g.
599"--notes --notes=foo --no-notes --notes=bar" will only show notes
600from "refs/notes/bar".</p>
601</dd>
602<dt class="hdlist1">--show-notes-by-default</dt>
603<dd>
604<p>Show the default notes unless options for displaying specific
605notes are given.</p>
606</dd>
607<dt class="hdlist1">--show-notes[=&lt;ref&gt;]</dt>
608<dt class="hdlist1">--[no-]standard-notes</dt>
609<dd>
610<p>These options are deprecated. Use the above --notes/--no-notes
611options instead.</p>
612</dd>
613<dt class="hdlist1">--show-signature</dt>
614<dd>
615<p>Check the validity of a signed commit object by passing the signature
Junio C Hamanodc392382024-10-11 18:57:29616to <code>gpg</code> <code>--verify</code> and show the output.</p>
Junio C Hamanob96f40a2024-08-01 00:57:25617</dd>
618</dl>
619</div>
620</div>
621</div>
622<div class="sect1">
623<h2 id="_pretty_formats">PRETTY FORMATS</h2>
624<div class="sectionbody">
625<div class="paragraph">
626<p>If the commit is a merge, and if the pretty-format
627is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
628inserted before the <em>Author:</em> line. This line begins with
629"Merge: " and the hashes of ancestral commits are printed,
630separated by spaces. Note that the listed commits may not
631necessarily be the list of the <strong>direct</strong> parent commits if you
632have limited your view of history: for example, if you are
633only interested in changes related to a certain directory or
634file.</p>
635</div>
636<div class="paragraph">
637<p>There are several built-in formats, and you can define
638additional formats by setting a pretty.&lt;name&gt;
639config option to either another format name, or a
640<em>format:</em> string, as described below (see
641<a href="git-config.html">git-config(1)</a>). Here are the details of the
642built-in formats:</p>
643</div>
644<div class="ulist">
645<ul>
646<li>
647<p><em>oneline</em></p>
648<div class="literalblock">
649<div class="content">
650<pre>&lt;hash&gt; &lt;title-line&gt;</pre>
651</div>
652</div>
653<div class="paragraph">
654<p>This is designed to be as compact as possible.</p>
655</div>
656</li>
657<li>
658<p><em>short</em></p>
659<div class="literalblock">
660<div class="content">
661<pre>commit &lt;hash&gt;
662Author: &lt;author&gt;</pre>
663</div>
664</div>
665<div class="literalblock">
666<div class="content">
667<pre>&lt;title-line&gt;</pre>
668</div>
669</div>
670</li>
671<li>
672<p><em>medium</em></p>
673<div class="literalblock">
674<div class="content">
675<pre>commit &lt;hash&gt;
676Author: &lt;author&gt;
677Date: &lt;author-date&gt;</pre>
678</div>
679</div>
680<div class="literalblock">
681<div class="content">
682<pre>&lt;title-line&gt;</pre>
683</div>
684</div>
685<div class="literalblock">
686<div class="content">
687<pre>&lt;full-commit-message&gt;</pre>
688</div>
689</div>
690</li>
691<li>
692<p><em>full</em></p>
693<div class="literalblock">
694<div class="content">
695<pre>commit &lt;hash&gt;
696Author: &lt;author&gt;
697Commit: &lt;committer&gt;</pre>
698</div>
699</div>
700<div class="literalblock">
701<div class="content">
702<pre>&lt;title-line&gt;</pre>
703</div>
704</div>
705<div class="literalblock">
706<div class="content">
707<pre>&lt;full-commit-message&gt;</pre>
708</div>
709</div>
710</li>
711<li>
712<p><em>fuller</em></p>
713<div class="literalblock">
714<div class="content">
715<pre>commit &lt;hash&gt;
716Author: &lt;author&gt;
717AuthorDate: &lt;author-date&gt;
718Commit: &lt;committer&gt;
719CommitDate: &lt;committer-date&gt;</pre>
720</div>
721</div>
722<div class="literalblock">
723<div class="content">
724<pre>&lt;title-line&gt;</pre>
725</div>
726</div>
727<div class="literalblock">
728<div class="content">
729<pre>&lt;full-commit-message&gt;</pre>
730</div>
731</div>
732</li>
733<li>
734<p><em>reference</em></p>
735<div class="literalblock">
736<div class="content">
737<pre>&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</pre>
738</div>
739</div>
740<div class="paragraph">
741<p>This format is used to refer to another commit in a commit message and
Junio C Hamanodc392382024-10-11 18:57:29742is the same as <code>--pretty=</code>'format:%C(<code>auto</code>)%h (%s, %ad)'. By default,
Junio C Hamanob96f40a2024-08-01 00:57:25743the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
744is explicitly specified. As with any <code>format:</code> with format
745placeholders, its output is not affected by other options like
746<code>--decorate</code> and <code>--walk-reflogs</code>.</p>
747</div>
748</li>
749<li>
750<p><em>email</em></p>
751<div class="literalblock">
752<div class="content">
753<pre>From &lt;hash&gt; &lt;date&gt;
754From: &lt;author&gt;
755Date: &lt;author-date&gt;
756Subject: [PATCH] &lt;title-line&gt;</pre>
757</div>
758</div>
759<div class="literalblock">
760<div class="content">
761<pre>&lt;full-commit-message&gt;</pre>
762</div>
763</div>
764</li>
765<li>
766<p><em>mboxrd</em></p>
767<div class="paragraph">
768<p>Like <em>email</em>, but lines in the commit message starting with "From "
769(preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
770confused as starting a new commit.</p>
771</div>
772</li>
773<li>
774<p><em>raw</em></p>
775<div class="paragraph">
776<p>The <em>raw</em> format shows the entire commit exactly as
777stored in the commit object. Notably, the hashes are
778displayed in full, regardless of whether --abbrev or
779--no-abbrev are used, and <em>parents</em> information show the
780true parent commits, without taking grafts or history
781simplification into account. Note that this format affects the way
782commits are displayed, but not the way the diff is shown e.g. with
Junio C Hamanodc392382024-10-11 18:57:29783<code>git</code> <code>log</code> <code>--raw</code>. To get full object names in a raw diff format,
Junio C Hamanob96f40a2024-08-01 00:57:25784use <code>--no-abbrev</code>.</p>
785</div>
786</li>
787<li>
788<p><em>format:&lt;format-string&gt;</em></p>
789<div class="paragraph">
790<p>The <em>format:&lt;format-string&gt;</em> format allows you to specify which information
791you want to show. It works a little bit like printf format,
792with the notable exception that you get a newline with <em>%n</em>
793instead of <em>\n</em>.</p>
794</div>
795<div class="paragraph">
796<p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
797would show something like this:</p>
798</div>
799<div class="listingblock">
800<div class="content">
801<pre>The author of fe6e0ee was Junio C Hamano, 23 hours ago
802The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</pre>
803</div>
804</div>
805<div class="paragraph">
806<p>The placeholders are:</p>
807</div>
808<div class="ulist">
809<ul>
810<li>
811<p>Placeholders that expand to a single literal character:</p>
812<div class="dlist">
813<dl>
814<dt class="hdlist1"><em>%n</em></dt>
815<dd>
816<p>newline</p>
817</dd>
818<dt class="hdlist1"><em>%%</em></dt>
819<dd>
820<p>a raw <em>%</em></p>
821</dd>
822<dt class="hdlist1"><em>%x00</em></dt>
823<dd>
824<p><em>%x</em> followed by two hexadecimal digits is replaced with a
825byte with the hexadecimal digits' value (we will call this
826"literal formatting code" in the rest of this document).</p>
827</dd>
828</dl>
829</div>
830</li>
831<li>
832<p>Placeholders that affect formatting of later placeholders:</p>
833<div class="dlist">
834<dl>
835<dt class="hdlist1"><em>%Cred</em></dt>
836<dd>
837<p>switch color to red</p>
838</dd>
839<dt class="hdlist1"><em>%Cgreen</em></dt>
840<dd>
841<p>switch color to green</p>
842</dd>
843<dt class="hdlist1"><em>%Cblue</em></dt>
844<dd>
845<p>switch color to blue</p>
846</dd>
847<dt class="hdlist1"><em>%Creset</em></dt>
848<dd>
849<p>reset color</p>
850</dd>
851<dt class="hdlist1"><em>%C(&#8230;&#8203;)</em></dt>
852<dd>
853<p>color specification, as described under Values in the
854"CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
855default, colors are shown only when enabled for log output
856(by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
857the <code>auto</code> settings of the former if we are going to a
Junio C Hamanodc392382024-10-11 18:57:29858terminal). %C(<code>auto,</code><code>...</code>) is accepted as a historical
859synonym for the default (e.g., %C(<code>auto,red</code>)). Specifying
860%C(<code>always,</code><code>...</code>) will show the colors even when color is
Junio C Hamanob96f40a2024-08-01 00:57:25861not otherwise enabled (though consider just using
862<code>--color=always</code> to enable color for the whole output,
863including this format and anything else git might color).
Junio C Hamanodc392382024-10-11 18:57:29864<code>auto</code> alone (i.e. %C(<code>auto</code>)) will turn on auto coloring
Junio C Hamanob96f40a2024-08-01 00:57:25865on the next placeholders until the color is switched
866again.</p>
867</dd>
868<dt class="hdlist1"><em>%m</em></dt>
869<dd>
Junio C Hamanodc392382024-10-11 18:57:29870<p>left (&lt;), right (&gt;) or boundary (<code>-</code>) mark</p>
Junio C Hamanob96f40a2024-08-01 00:57:25871</dd>
872<dt class="hdlist1"><em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em></dt>
873<dd>
874<p>switch line wrapping, like the -w option of
875<a href="git-shortlog.html">git-shortlog(1)</a>.</p>
876</dd>
877<dt class="hdlist1"><em>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</em></dt>
878<dd>
879<p>make the next placeholder take at
880least N column widths, padding spaces on
881the right if necessary. Optionally
Junio C Hamanodc392382024-10-11 18:57:29882truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..</code><code>ft</code>,
883the middle (mtrunc) <code>mi</code><code>..</code><code>le</code>, or the end
Junio C Hamanob96f40a2024-08-01 00:57:25884(trunc) <code>rig..</code>, if the output is longer than
885N columns.
886Note 1: that truncating
887only works correctly with N &gt;= 2.
888Note 2: spaces around the N and M (see below)
889values are optional.
890Note 3: Emojis and other wide characters
891will take two display columns, which may
892over-run column boundaries.
893Note 4: decomposed character combining marks
894may be misplaced at padding boundaries.</p>
895</dd>
896<dt class="hdlist1"><em>%&lt;|( &lt;M&gt; )</em></dt>
897<dd>
898<p>make the next placeholder take at least until Mth
899display column, padding spaces on the right if necessary.
900Use negative M values for column positions measured
901from the right hand edge of the terminal window.</p>
902</dd>
903<dt class="hdlist1"><em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em></dt>
904<dd>
905<p>similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em> respectively,
906but padding spaces on the left</p>
907</dd>
908<dt class="hdlist1"><em>%&gt;&gt;( &lt;N&gt; )</em>, <em>%&gt;&gt;|( &lt;M&gt; )</em></dt>
909<dd>
910<p>similar to <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
911respectively, except that if the next
912placeholder takes more spaces than given and
913there are spaces on its left, use those
914spaces</p>
915</dd>
916<dt class="hdlist1"><em>%&gt;&lt;( &lt;N&gt; )</em>, <em>%&gt;&lt;|( &lt;M&gt; )</em></dt>
917<dd>
918<p>similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em>
919respectively, but padding both sides
920(i.e. the text is centered)</p>
921</dd>
922</dl>
923</div>
924</li>
925<li>
926<p>Placeholders that expand to information extracted from the commit:</p>
927<div class="dlist">
928<dl>
929<dt class="hdlist1"><em>%H</em></dt>
930<dd>
931<p>commit hash</p>
932</dd>
933<dt class="hdlist1"><em>%h</em></dt>
934<dd>
935<p>abbreviated commit hash</p>
936</dd>
937<dt class="hdlist1"><em>%T</em></dt>
938<dd>
939<p>tree hash</p>
940</dd>
941<dt class="hdlist1"><em>%t</em></dt>
942<dd>
943<p>abbreviated tree hash</p>
944</dd>
945<dt class="hdlist1"><em>%P</em></dt>
946<dd>
947<p>parent hashes</p>
948</dd>
949<dt class="hdlist1"><em>%p</em></dt>
950<dd>
951<p>abbreviated parent hashes</p>
952</dd>
953<dt class="hdlist1"><em>%an</em></dt>
954<dd>
955<p>author name</p>
956</dd>
957<dt class="hdlist1"><em>%aN</em></dt>
958<dd>
959<p>author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
960or <a href="git-blame.html">git-blame(1)</a>)</p>
961</dd>
962<dt class="hdlist1"><em>%ae</em></dt>
963<dd>
964<p>author email</p>
965</dd>
966<dt class="hdlist1"><em>%aE</em></dt>
967<dd>
968<p>author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
969or <a href="git-blame.html">git-blame(1)</a>)</p>
970</dd>
971<dt class="hdlist1"><em>%al</em></dt>
972<dd>
973<p>author email local-part (the part before the <em>@</em> sign)</p>
974</dd>
975<dt class="hdlist1"><em>%aL</em></dt>
976<dd>
977<p>author local-part (see <em>%al</em>) respecting .mailmap, see
978<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
979</dd>
980<dt class="hdlist1"><em>%ad</em></dt>
981<dd>
982<p>author date (format respects --date= option)</p>
983</dd>
984<dt class="hdlist1"><em>%aD</em></dt>
985<dd>
986<p>author date, RFC2822 style</p>
987</dd>
988<dt class="hdlist1"><em>%ar</em></dt>
989<dd>
990<p>author date, relative</p>
991</dd>
992<dt class="hdlist1"><em>%at</em></dt>
993<dd>
994<p>author date, UNIX timestamp</p>
995</dd>
996<dt class="hdlist1"><em>%ai</em></dt>
997<dd>
998<p>author date, ISO 8601-like format</p>
999</dd>
1000<dt class="hdlist1"><em>%aI</em></dt>
1001<dd>
1002<p>author date, strict ISO 8601 format</p>
1003</dd>
1004<dt class="hdlist1"><em>%as</em></dt>
1005<dd>
1006<p>author date, short format (<code>YYYY-MM-DD</code>)</p>
1007</dd>
1008<dt class="hdlist1"><em>%ah</em></dt>
1009<dd>
1010<p>author date, human style (like the <code>--date=human</code> option of
1011<a href="git-rev-list.html">git-rev-list(1)</a>)</p>
1012</dd>
1013<dt class="hdlist1"><em>%cn</em></dt>
1014<dd>
1015<p>committer name</p>
1016</dd>
1017<dt class="hdlist1"><em>%cN</em></dt>
1018<dd>
1019<p>committer name (respecting .mailmap, see
1020<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
1021</dd>
1022<dt class="hdlist1"><em>%ce</em></dt>
1023<dd>
1024<p>committer email</p>
1025</dd>
1026<dt class="hdlist1"><em>%cE</em></dt>
1027<dd>
1028<p>committer email (respecting .mailmap, see
1029<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
1030</dd>
1031<dt class="hdlist1"><em>%cl</em></dt>
1032<dd>
1033<p>committer email local-part (the part before the <em>@</em> sign)</p>
1034</dd>
1035<dt class="hdlist1"><em>%cL</em></dt>
1036<dd>
1037<p>committer local-part (see <em>%cl</em>) respecting .mailmap, see
1038<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
1039</dd>
1040<dt class="hdlist1"><em>%cd</em></dt>
1041<dd>
1042<p>committer date (format respects --date= option)</p>
1043</dd>
1044<dt class="hdlist1"><em>%cD</em></dt>
1045<dd>
1046<p>committer date, RFC2822 style</p>
1047</dd>
1048<dt class="hdlist1"><em>%cr</em></dt>
1049<dd>
1050<p>committer date, relative</p>
1051</dd>
1052<dt class="hdlist1"><em>%ct</em></dt>
1053<dd>
1054<p>committer date, UNIX timestamp</p>
1055</dd>
1056<dt class="hdlist1"><em>%ci</em></dt>
1057<dd>
1058<p>committer date, ISO 8601-like format</p>
1059</dd>
1060<dt class="hdlist1"><em>%cI</em></dt>
1061<dd>
1062<p>committer date, strict ISO 8601 format</p>
1063</dd>
1064<dt class="hdlist1"><em>%cs</em></dt>
1065<dd>
1066<p>committer date, short format (<code>YYYY-MM-DD</code>)</p>
1067</dd>
1068<dt class="hdlist1"><em>%ch</em></dt>
1069<dd>
1070<p>committer date, human style (like the <code>--date=human</code> option of
1071<a href="git-rev-list.html">git-rev-list(1)</a>)</p>
1072</dd>
1073<dt class="hdlist1"><em>%d</em></dt>
1074<dd>
1075<p>ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a></p>
1076</dd>
1077<dt class="hdlist1"><em>%D</em></dt>
1078<dd>
1079<p>ref names without the " (", ")" wrapping.</p>
1080</dd>
1081<dt class="hdlist1"><em>%(decorate[:&lt;options&gt;])</em></dt>
1082<dd>
1083<p>ref names with custom decorations. The <code>decorate</code> string may be followed by a
1084colon and zero or more comma-separated options. Option values may contain
Junio C Hamanodc392382024-10-11 18:57:291085literal formatting codes. These must be used for commas (%x2C) and closing
1086parentheses (%x29), due to their role in the option syntax.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251087<div class="ulist">
1088<ul>
1089<li>
Junio C Hamanodc392382024-10-11 18:57:291090<p><em>prefix=&lt;value&gt;</em>: Shown before the list of ref names. Defaults to "&#160;(".</p>
Junio C Hamanob96f40a2024-08-01 00:57:251091</li>
1092<li>
Junio C Hamanodc392382024-10-11 18:57:291093<p><em>suffix=&lt;value&gt;</em>: Shown after the list of ref names. Defaults to ")".</p>
Junio C Hamanob96f40a2024-08-01 00:57:251094</li>
1095<li>
1096<p><em>separator=&lt;value&gt;</em>: Shown between ref names. Defaults to "<code>,</code>&#160;".</p>
1097</li>
1098<li>
1099<p><em>pointer=&lt;value&gt;</em>: Shown between HEAD and the branch it points to, if any.
Junio C Hamanodc392382024-10-11 18:57:291100Defaults to "&#160;<code>-</code>&gt;&#160;".</p>
Junio C Hamanob96f40a2024-08-01 00:57:251101</li>
1102<li>
1103<p><em>tag=&lt;value&gt;</em>: Shown before tag names. Defaults to "<code>tag:</code>&#160;".</p>
1104</li>
1105</ul>
1106</div>
1107</dd>
1108</dl>
1109</div>
1110</li>
1111</ul>
1112</div>
1113<div class="paragraph">
1114<p>For example, to produce decorations with no wrapping
1115or tag annotations, and spaces as separators:</p>
1116</div>
1117<div class="paragraph">
1118<p>+
Junio C Hamanodc392382024-10-11 18:57:291119%(<code>decorate:prefix=,suffix=,tag=,separator=</code> )</p>
Junio C Hamanob96f40a2024-08-01 00:57:251120</div>
1121<div class="dlist">
1122<dl>
1123<dt class="hdlist1"><em>%(describe[:&lt;options&gt;])</em></dt>
1124<dd>
1125<p>human-readable name, like <a href="git-describe.html">git-describe(1)</a>; empty string for
1126undescribable commits. The <code>describe</code> string may be followed by a colon and
1127zero or more comma-separated options. Descriptions can be inconsistent when
1128tags are added or removed at the same time.</p>
1129<div class="ulist">
1130<ul>
1131<li>
1132<p><em>tags[=&lt;bool-value&gt;]</em>: Instead of only considering annotated tags,
1133consider lightweight tags as well.</p>
1134</li>
1135<li>
1136<p><em>abbrev=&lt;number&gt;</em>: Instead of using the default number of hexadecimal digits
1137(which will vary according to the number of objects in the repository with a
1138default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
1139digits as needed to form a unique object name.</p>
1140</li>
1141<li>
1142<p><em>match=&lt;pattern&gt;</em>: Only consider tags matching the given
Junio C Hamanodc392382024-10-11 18:57:291143<code>glob</code>(<code>7</code>) pattern, excluding the "refs/tags/" prefix.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251144</li>
1145<li>
1146<p><em>exclude=&lt;pattern&gt;</em>: Do not consider tags matching the given
Junio C Hamanodc392382024-10-11 18:57:291147<code>glob</code>(<code>7</code>) pattern, excluding the "refs/tags/" prefix.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251148</li>
1149</ul>
1150</div>
1151</dd>
1152<dt class="hdlist1"><em>%S</em></dt>
1153<dd>
1154<p>ref name given on the command line by which the commit was reached
Junio C Hamanodc392382024-10-11 18:57:291155(like <code>git</code> <code>log</code> <code>--source</code>), only works with <code>git</code> <code>log</code></p>
Junio C Hamanob96f40a2024-08-01 00:57:251156</dd>
1157<dt class="hdlist1"><em>%e</em></dt>
1158<dd>
1159<p>encoding</p>
1160</dd>
1161<dt class="hdlist1"><em>%s</em></dt>
1162<dd>
1163<p>subject</p>
1164</dd>
1165<dt class="hdlist1"><em>%f</em></dt>
1166<dd>
1167<p>sanitized subject line, suitable for a filename</p>
1168</dd>
1169<dt class="hdlist1"><em>%b</em></dt>
1170<dd>
1171<p>body</p>
1172</dd>
1173<dt class="hdlist1"><em>%B</em></dt>
1174<dd>
1175<p>raw body (unwrapped subject and body)</p>
1176</dd>
1177<dt class="hdlist1"><em>%N</em></dt>
1178<dd>
1179<p>commit notes</p>
1180</dd>
1181<dt class="hdlist1"><em>%GG</em></dt>
1182<dd>
1183<p>raw verification message from GPG for a signed commit</p>
1184</dd>
1185<dt class="hdlist1"><em>%G?</em></dt>
1186<dd>
1187<p>show "G" for a good (valid) signature,
1188"B" for a bad signature,
1189"U" for a good signature with unknown validity,
1190"X" for a good signature that has expired,
1191"Y" for a good signature made by an expired key,
1192"R" for a good signature made by a revoked key,
1193"E" if the signature cannot be checked (e.g. missing key)
1194and "N" for no signature</p>
1195</dd>
1196<dt class="hdlist1"><em>%GS</em></dt>
1197<dd>
1198<p>show the name of the signer for a signed commit</p>
1199</dd>
1200<dt class="hdlist1"><em>%GK</em></dt>
1201<dd>
1202<p>show the key used to sign a signed commit</p>
1203</dd>
1204<dt class="hdlist1"><em>%GF</em></dt>
1205<dd>
1206<p>show the fingerprint of the key used to sign a signed commit</p>
1207</dd>
1208<dt class="hdlist1"><em>%GP</em></dt>
1209<dd>
1210<p>show the fingerprint of the primary key whose subkey was used
1211to sign a signed commit</p>
1212</dd>
1213<dt class="hdlist1"><em>%GT</em></dt>
1214<dd>
1215<p>show the trust level for the key used to sign a signed commit</p>
1216</dd>
1217<dt class="hdlist1"><em>%gD</em></dt>
1218<dd>
Junio C Hamanodc392382024-10-11 18:57:291219<p>reflog selector, e.g., <code>refs/stash@</code>{1} or <code>refs/stash@</code>{2
1220<code>minutes</code> <code>ago</code>}; the format follows the rules described for the
Junio C Hamanob96f40a2024-08-01 00:57:251221<code>-g</code> option. The portion before the <code>@</code> is the refname as
Junio C Hamanodc392382024-10-11 18:57:291222given on the command line (so <code>git</code> <code>log</code> <code>-g</code> <code>refs/heads/master</code>
1223would yield <code>refs/heads/master@</code>{0}).</p>
Junio C Hamanob96f40a2024-08-01 00:57:251224</dd>
1225<dt class="hdlist1"><em>%gd</em></dt>
1226<dd>
Junio C Hamanodc392382024-10-11 18:57:291227<p>shortened reflog selector; same as %gD, but the refname
Junio C Hamanob96f40a2024-08-01 00:57:251228portion is shortened for human readability (so
1229<code>refs/heads/master</code> becomes just <code>master</code>).</p>
1230</dd>
1231<dt class="hdlist1"><em>%gn</em></dt>
1232<dd>
1233<p>reflog identity name</p>
1234</dd>
1235<dt class="hdlist1"><em>%gN</em></dt>
1236<dd>
1237<p>reflog identity name (respecting .mailmap, see
1238<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
1239</dd>
1240<dt class="hdlist1"><em>%ge</em></dt>
1241<dd>
1242<p>reflog identity email</p>
1243</dd>
1244<dt class="hdlist1"><em>%gE</em></dt>
1245<dd>
1246<p>reflog identity email (respecting .mailmap, see
1247<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
1248</dd>
1249<dt class="hdlist1"><em>%gs</em></dt>
1250<dd>
1251<p>reflog subject</p>
1252</dd>
1253<dt class="hdlist1"><em>%(trailers[:&lt;options&gt;])</em></dt>
1254<dd>
1255<p>display the trailers of the body as interpreted by
1256<a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be followed by
1257a colon and zero or more comma-separated options. If any option is provided
1258multiple times, the last occurrence wins.</p>
1259<div class="ulist">
1260<ul>
1261<li>
1262<p><em>key=&lt;key&gt;</em>: only show trailers with specified &lt;key&gt;. Matching is done
1263case-insensitively and trailing colon is optional. If option is
1264given multiple times trailer lines matching any of the keys are
1265shown. This option automatically enables the <code>only</code> option so that
1266non-trailer lines in the trailer block are hidden. If that is not
1267desired it can be disabled with <code>only=false</code>. E.g.,
Junio C Hamanodc392382024-10-11 18:57:291268%(<code>trailers:key=Reviewed-by</code>) shows trailer lines with key
Junio C Hamanob96f40a2024-08-01 00:57:251269<code>Reviewed-by</code>.</p>
1270</li>
1271<li>
1272<p><em>only[=&lt;bool&gt;]</em>: select whether non-trailer lines from the trailer
1273block should be included.</p>
1274</li>
1275<li>
1276<p><em>separator=&lt;sep&gt;</em>: specify the separator inserted between trailer
1277lines. Defaults to a line feed character. The string &lt;sep&gt; may contain
1278the literal formatting codes described above. To use comma as
Junio C Hamanodc392382024-10-11 18:57:291279separator one must use %x2C as it would otherwise be parsed as
1280next option. E.g., %(<code>trailers:key=Ticket,separator=</code>%x2C )
Junio C Hamanob96f40a2024-08-01 00:57:251281shows all trailer lines whose key is "Ticket" separated by a comma
1282and a space.</p>
1283</li>
1284<li>
1285<p><em>unfold[=&lt;bool&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
1286option was given. E.g.,
Junio C Hamanodc392382024-10-11 18:57:291287%(<code>trailers:only,unfold=true</code>) unfolds and shows all trailer lines.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251288</li>
1289<li>
1290<p><em>keyonly[=&lt;bool&gt;]</em>: only show the key part of the trailer.</p>
1291</li>
1292<li>
1293<p><em>valueonly[=&lt;bool&gt;]</em>: only show the value part of the trailer.</p>
1294</li>
1295<li>
1296<p><em>key_value_separator=&lt;sep&gt;</em>: specify the separator inserted between
1297the key and value of each trailer. Defaults to ": ". Otherwise it
1298shares the same semantics as <em>separator=&lt;sep&gt;</em> above.</p>
1299</li>
1300</ul>
1301</div>
1302</dd>
1303</dl>
1304</div>
1305</li>
1306</ul>
1307</div>
1308<div class="admonitionblock note">
1309<table>
1310<tr>
1311<td class="icon">
1312<div class="title">Note</div>
1313</td>
1314<td class="content">
1315Some placeholders may depend on other options given to the
Junio C Hamanodc392382024-10-11 18:57:291316revision traversal engine. For example, the %g* reflog options will
Junio C Hamanob96f40a2024-08-01 00:57:251317insert an empty string unless we are traversing reflog entries (e.g., by
Junio C Hamanodc392382024-10-11 18:57:291318<code>git</code> <code>log</code> <code>-g</code>). The %d and %D placeholders will use the "short"
Junio C Hamanob96f40a2024-08-01 00:57:251319decoration format if <code>--decorate</code> was not already provided on the command
1320line.
1321</td>
1322</tr>
1323</table>
1324</div>
1325<div class="paragraph">
Junio C Hamanob358e212025-02-21 21:47:021326<p>The boolean options accept an optional value [<code>=</code><em>&lt;bool-value&gt;</em>]. The
1327values taken by <code>--type=bool</code> git-config[1], like <code>yes</code> and <code>off</code>,
1328are all accepted. Giving a boolean option without <code>=</code><em>&lt;value&gt;</em> is
1329equivalent to giving it with <code>=true</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251330</div>
1331<div class="paragraph">
1332<p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
1333is inserted immediately before the expansion if and only if the
1334placeholder expands to a non-empty string.</p>
1335</div>
1336<div class="paragraph">
1337<p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
1338line-feeds immediately preceding the expansion are deleted if and only if the
1339placeholder expands to an empty string.</p>
1340</div>
1341<div class="paragraph">
1342<p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
1343is inserted immediately before the expansion if and only if the
1344placeholder expands to a non-empty string.</p>
1345</div>
1346<div class="ulist">
1347<ul>
1348<li>
1349<p><em>tformat:</em></p>
1350<div class="paragraph">
1351<p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
1352provides "terminator" semantics instead of "separator" semantics. In
1353other words, each commit has the message terminator character (usually a
1354newline) appended, rather than a separator placed between entries.
1355This means that the final entry of a single-line format will be properly
1356terminated with a new line, just as the "oneline" format does.
1357For example:</p>
1358</div>
1359<div class="listingblock">
1360<div class="content">
1361<pre>$ git log -2 --pretty=format:%h 4da45bef \
1362 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
13634da45be
13647134973 -- NO NEWLINE
1365
1366$ git log -2 --pretty=tformat:%h 4da45bef \
1367 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
13684da45be
13697134973</pre>
1370</div>
1371</div>
1372<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291373<p>In addition, any unrecognized string that has a % in it is interpreted
Junio C Hamanob96f40a2024-08-01 00:57:251374as if it has <code>tformat:</code> in front of it. For example, these two are
1375equivalent:</p>
1376</div>
1377<div class="listingblock">
1378<div class="content">
1379<pre>$ git log -2 --pretty=tformat:%h 4da45bef
1380$ git log -2 --pretty=%h 4da45bef</pre>
1381</div>
1382</div>
1383</li>
1384</ul>
1385</div>
1386</div>
1387</div>
1388<div class="sect1">
1389<h2 id="_diff_formatting">DIFF FORMATTING</h2>
1390<div class="sectionbody">
1391<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291392<p>The options below can be used to change the way <code>git</code> <code>show</code> generates
Junio C Hamanob96f40a2024-08-01 00:57:251393diff output.</p>
1394</div>
1395<div class="dlist">
1396<dl>
Junio C Hamano7f7e6a42024-12-04 04:45:581397<dt class="hdlist1"><code>-p</code></dt>
1398<dt class="hdlist1"><code>-u</code></dt>
1399<dt class="hdlist1"><code>--patch</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251400<dd>
1401<p>Generate patch (see <a href="#generate_patch_text_with_p">Generating patch text with -p</a>).</p>
1402</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581403<dt class="hdlist1"><code>-s</code></dt>
1404<dt class="hdlist1"><code>--no-patch</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251405<dd>
1406<p>Suppress all output from the diff machinery. Useful for
Junio C Hamanodc392382024-10-11 18:57:291407commands like <code>git</code> <code>show</code> that show the patch by default to
Junio C Hamanob96f40a2024-08-01 00:57:251408squelch their output, or to cancel the effect of options like
1409<code>--patch</code>, <code>--stat</code> earlier on the command line in an alias.</p>
1410</dd>
1411<dt class="hdlist1">-m</dt>
1412<dd>
1413<p>Show diffs for merge commits in the default format. This is
Junio C Hamano7f7e6a42024-12-04 04:45:581414similar to <code>--diff-merges=on</code>, except <code>-m</code> will
Junio C Hamanob96f40a2024-08-01 00:57:251415produce no output unless <code>-p</code> is given as well.</p>
1416</dd>
1417<dt class="hdlist1">-c</dt>
1418<dd>
1419<p>Produce combined diff output for merge commits.
Junio C Hamano7f7e6a42024-12-04 04:45:581420Shortcut for <code>--diff-merges=combined</code> <code>-p</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251421</dd>
1422<dt class="hdlist1">--cc</dt>
1423<dd>
1424<p>Produce dense combined diff output for merge commits.
Junio C Hamano7f7e6a42024-12-04 04:45:581425Shortcut for <code>--diff-merges=dense-combined</code> <code>-p</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251426</dd>
1427<dt class="hdlist1">--dd</dt>
1428<dd>
1429<p>Produce diff with respect to first parent for both merge and
1430regular commits.
Junio C Hamano7f7e6a42024-12-04 04:45:581431Shortcut for <code>--diff-merges=first-parent</code> <code>-p</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251432</dd>
1433<dt class="hdlist1">--remerge-diff</dt>
1434<dd>
1435<p>Produce remerge-diff output for merge commits.
Junio C Hamano7f7e6a42024-12-04 04:45:581436Shortcut for <code>--diff-merges=remerge</code> <code>-p</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251437</dd>
1438<dt class="hdlist1">--no-diff-merges</dt>
1439<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581440<p>Synonym for <code>--diff-merges=off</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251441</dd>
1442<dt class="hdlist1">--diff-merges=&lt;format&gt;</dt>
1443<dd>
1444<p>Specify diff format to be used for merge commits. Default is
1445`dense-combined` unless <code>--first-parent</code> is in use, in
1446which case <code>first-parent</code> is the default.</p>
1447<div class="paragraph">
1448<p>The following formats are supported:</p>
1449</div>
1450<div class="openblock">
1451<div class="content">
1452<div class="dlist">
1453<dl>
1454<dt class="hdlist1">off, none</dt>
1455<dd>
1456<p>Disable output of diffs for merge commits. Useful to override
1457implied value.</p>
1458</dd>
1459<dt class="hdlist1">on, m</dt>
1460<dd>
1461<p>Make diff output for merge commits to be shown in the default
1462format. The default format can be changed using
1463<code>log.diffMerges</code> configuration variable, whose default value
1464is <code>separate</code>.</p>
1465</dd>
1466<dt class="hdlist1">first-parent, 1</dt>
1467<dd>
1468<p>Show full diff with respect to first parent. This is the same
1469format as <code>--patch</code> produces for non-merge commits.</p>
1470</dd>
1471<dt class="hdlist1">separate</dt>
1472<dd>
1473<p>Show full diff with respect to each of parents.
1474Separate log entry and diff is generated for each parent.</p>
1475</dd>
1476<dt class="hdlist1">combined, c</dt>
1477<dd>
1478<p>Show differences from each of the parents to the merge
1479result simultaneously instead of showing pairwise diff between
1480a parent and the result one at a time. Furthermore, it lists
1481only files which were modified from all parents.</p>
1482</dd>
1483<dt class="hdlist1">dense-combined, cc</dt>
1484<dd>
1485<p>Further compress output produced by <code>--diff-merges=combined</code>
1486by omitting uninteresting hunks whose contents in the parents
1487have only two variants and the merge result picks one of them
1488without modification.</p>
1489</dd>
1490<dt class="hdlist1">remerge, r</dt>
1491<dd>
1492<p>Remerge two-parent merge commits to create a temporary tree
1493object&#8212;&#8203;potentially containing files with conflict markers
1494and such. A diff is then shown between that temporary tree
1495and the actual merge commit.</p>
1496<div class="paragraph">
1497<p>The output emitted when this option is used is subject to change, and
1498so is its interaction with other options (unless explicitly
1499documented).</p>
1500</div>
1501</dd>
1502</dl>
1503</div>
1504</div>
1505</div>
1506</dd>
1507<dt class="hdlist1">--combined-all-paths</dt>
1508<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581509<p>Cause combined diffs (used for merge commits) to
Junio C Hamanob96f40a2024-08-01 00:57:251510list the name of the file from all parents. It thus only has
Junio C Hamanodc392382024-10-11 18:57:291511effect when <code>--diff-merges=</code>[<code>dense-</code>]<code>combined</code> is in use, and
Junio C Hamanob96f40a2024-08-01 00:57:251512is likely only useful if filename changes are detected (i.e.
1513when either rename or copy detection have been requested).</p>
1514</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581515<dt class="hdlist1"><code>-U</code><em>&lt;n&gt;</em></dt>
1516<dt class="hdlist1"><code>--unified=</code><em>&lt;n&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251517<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581518<p>Generate diffs with <em>&lt;n&gt;</em> lines of context instead of
Junio C Hamanob96f40a2024-08-01 00:57:251519the usual three.
1520Implies <code>--patch</code>.</p>
1521</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581522<dt class="hdlist1"><code>--output=</code><em>&lt;file&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251523<dd>
1524<p>Output to a specific file instead of stdout.</p>
1525</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581526<dt class="hdlist1"><code>--output-indicator-new=</code><em>&lt;char&gt;</em></dt>
1527<dt class="hdlist1"><code>--output-indicator-old=</code><em>&lt;char&gt;</em></dt>
1528<dt class="hdlist1"><code>--output-indicator-context=</code><em>&lt;char&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251529<dd>
1530<p>Specify the character used to indicate new, old or context
Junio C Hamano7f7e6a42024-12-04 04:45:581531lines in the generated patch. Normally they are <code>+</code>, <code>-</code> and
Junio C Hamanob96f40a2024-08-01 00:57:251532' ' respectively.</p>
1533</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581534<dt class="hdlist1"><code>--raw</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251535<dd>
1536<p>For each commit, show a summary of changes using the raw diff
1537format. See the "RAW OUTPUT FORMAT" section of
1538<a href="git-diff.html">git-diff(1)</a>. This is different from showing the log
1539itself in raw format, which you can achieve with
1540<code>--format=raw</code>.</p>
1541</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581542<dt class="hdlist1"><code>--patch-with-raw</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251543<dd>
Junio C Hamanodc392382024-10-11 18:57:291544<p>Synonym for <code>-p</code> <code>--raw</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251545</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581546<dt class="hdlist1"><code>-t</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251547<dd>
1548<p>Show the tree objects in the diff output.</p>
1549</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581550<dt class="hdlist1"><code>--indent-heuristic</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251551<dd>
1552<p>Enable the heuristic that shifts diff hunk boundaries to make patches
1553easier to read. This is the default.</p>
1554</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581555<dt class="hdlist1"><code>--no-indent-heuristic</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251556<dd>
1557<p>Disable the indent heuristic.</p>
1558</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581559<dt class="hdlist1"><code>--minimal</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251560<dd>
1561<p>Spend extra time to make sure the smallest possible
1562diff is produced.</p>
1563</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581564<dt class="hdlist1"><code>--patience</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251565<dd>
1566<p>Generate a diff using the "patience diff" algorithm.</p>
1567</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581568<dt class="hdlist1"><code>--histogram</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251569<dd>
1570<p>Generate a diff using the "histogram diff" algorithm.</p>
1571</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581572<dt class="hdlist1"><code>--anchored=</code><em>&lt;text&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251573<dd>
1574<p>Generate a diff using the "anchored diff" algorithm.</p>
1575<div class="paragraph">
1576<p>This option may be specified more than once.</p>
1577</div>
1578<div class="paragraph">
1579<p>If a line exists in both the source and destination, exists only once,
Junio C Hamano7f7e6a42024-12-04 04:45:581580and starts with <em>&lt;text&gt;</em>, this algorithm attempts to prevent it from
Junio C Hamanob96f40a2024-08-01 00:57:251581appearing as a deletion or addition in the output. It uses the "patience
1582diff" algorithm internally.</p>
1583</div>
1584</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581585<dt class="hdlist1"><code>--diff-algorithm=</code>(<code>patience</code>|<code>minimal</code>|<code>histogram</code>|<code>myers</code>)</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251586<dd>
1587<p>Choose a diff algorithm. The variants are as follows:</p>
1588<div class="openblock">
1589<div class="content">
1590<div class="dlist">
1591<dl>
Junio C Hamano7f7e6a42024-12-04 04:45:581592<dt class="hdlist1"><code>default</code></dt>
1593<dt class="hdlist1"><code>myers</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251594<dd>
1595<p>The basic greedy diff algorithm. Currently, this is the default.</p>
1596</dd>
1597<dt class="hdlist1"><code>minimal</code></dt>
1598<dd>
1599<p>Spend extra time to make sure the smallest possible diff is
1600produced.</p>
1601</dd>
1602<dt class="hdlist1"><code>patience</code></dt>
1603<dd>
1604<p>Use "patience diff" algorithm when generating patches.</p>
1605</dd>
1606<dt class="hdlist1"><code>histogram</code></dt>
1607<dd>
1608<p>This algorithm extends the patience algorithm to "support
1609low-occurrence common elements".</p>
1610</dd>
1611</dl>
1612</div>
1613</div>
1614</div>
1615<div class="paragraph">
1616<p>For instance, if you configured the <code>diff.algorithm</code> variable to a
1617non-default value and want to use the default one, then you
1618have to use <code>--diff-algorithm=default</code> option.</p>
1619</div>
1620</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581621<dt class="hdlist1"><code>--stat</code>[<code>=</code><em>&lt;width&gt;</em>[<code>,</code><em>&lt;name-width&gt;</em>[<code>,</code><em>&lt;count&gt;</em>]]]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251622<dd>
1623<p>Generate a diffstat. By default, as much space as necessary
1624will be used for the filename part, and the rest for the graph
1625part. Maximum width defaults to terminal width, or 80 columns
1626if not connected to a terminal, and can be overridden by
Junio C Hamanodc392382024-10-11 18:57:291627<em>&lt;width&gt;</em>. The width of the filename part can be limited by
1628giving another width <em>&lt;name-width&gt;</em> after a comma or by setting
Junio C Hamano7f7e6a42024-12-04 04:45:581629<code>diff.statNameWidth=</code><em>&lt;name-width&gt;</em>. The width of the graph part can be
1630limited by using <code>--stat-graph-width=</code><em>&lt;graph-width&gt;</em> or by setting
1631<code>diff.statGraphWidth=</code><em>&lt;graph-width&gt;</em>. Using <code>--stat</code> or
Junio C Hamanob96f40a2024-08-01 00:57:251632<code>--stat-graph-width</code> affects all commands generating a stat graph,
1633while setting <code>diff.statNameWidth</code> or <code>diff.statGraphWidth</code>
Junio C Hamanodc392382024-10-11 18:57:291634does not affect <code>git</code> <code>format-patch</code>.
1635By giving a third parameter <em>&lt;count&gt;</em>, you can limit the output to
1636the first <em>&lt;count&gt;</em> lines, followed by ... if there are more.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251637<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:291638<p>These parameters can also be set individually with <code>--stat-width=</code><em>&lt;width&gt;</em>,
1639<code>--stat-name-width=</code><em>&lt;name-width&gt;</em> and <code>--stat-count=</code><em>&lt;count&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251640</div>
1641</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581642<dt class="hdlist1"><code>--compact-summary</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251643<dd>
1644<p>Output a condensed summary of extended header information such
Junio C Hamano7f7e6a42024-12-04 04:45:581645as file creations or deletions ("new" or "gone", optionally <code>+l</code>
1646if it&#8217;s a symlink) and mode changes (<code>+x</code> or <code>-x</code> for adding
Junio C Hamanob96f40a2024-08-01 00:57:251647or removing executable bit respectively) in diffstat. The
1648information is put between the filename part and the graph
1649part. Implies <code>--stat</code>.</p>
1650</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581651<dt class="hdlist1"><code>--numstat</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251652<dd>
1653<p>Similar to <code>--stat</code>, but shows number of added and
1654deleted lines in decimal notation and pathname without
1655abbreviation, to make it more machine friendly. For
1656binary files, outputs two <code>-</code> instead of saying
Junio C Hamanodc392382024-10-11 18:57:291657<code>0</code> <code>0</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251658</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581659<dt class="hdlist1"><code>--shortstat</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251660<dd>
1661<p>Output only the last line of the <code>--stat</code> format containing total
1662number of modified files, as well as number of added and deleted
1663lines.</p>
1664</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581665<dt class="hdlist1"><code>-X</code> [<em>&lt;param&gt;</em><code>,..</code>.]</dt>
1666<dt class="hdlist1"><code>--dirstat</code>[<code>=</code><em>&lt;param&gt;</em><code>,..</code>.]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251667<dd>
1668<p>Output the distribution of relative amount of changes for each
1669sub-directory. The behavior of <code>--dirstat</code> can be customized by
1670passing it a comma separated list of parameters.
1671The defaults are controlled by the <code>diff.dirstat</code> configuration
1672variable (see <a href="git-config.html">git-config(1)</a>).
1673The following parameters are available:</p>
1674<div class="openblock">
1675<div class="content">
1676<div class="dlist">
1677<dl>
1678<dt class="hdlist1"><code>changes</code></dt>
1679<dd>
1680<p>Compute the dirstat numbers by counting the lines that have been
1681removed from the source, or added to the destination. This ignores
1682the amount of pure code movements within a file. In other words,
1683rearranging lines in a file is not counted as much as other changes.
1684This is the default behavior when no parameter is given.</p>
1685</dd>
1686<dt class="hdlist1"><code>lines</code></dt>
1687<dd>
1688<p>Compute the dirstat numbers by doing the regular line-based diff
1689analysis, and summing the removed/added line counts. (For binary
1690files, count 64-byte chunks instead, since binary files have no
1691natural concept of lines). This is a more expensive <code>--dirstat</code>
1692behavior than the <code>changes</code> behavior, but it does count rearranged
1693lines within a file as much as other changes. The resulting output
Junio C Hamanodc392382024-10-11 18:57:291694is consistent with what you get from the other <code>--</code>*stat options.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251695</dd>
1696<dt class="hdlist1"><code>files</code></dt>
1697<dd>
1698<p>Compute the dirstat numbers by counting the number of files changed.
1699Each changed file counts equally in the dirstat analysis. This is
1700the computationally cheapest <code>--dirstat</code> behavior, since it does
1701not have to look at the file contents at all.</p>
1702</dd>
1703<dt class="hdlist1"><code>cumulative</code></dt>
1704<dd>
1705<p>Count changes in a child directory for the parent directory as well.
1706Note that when using <code>cumulative</code>, the sum of the percentages
1707reported may exceed 100%. The default (non-cumulative) behavior can
1708be specified with the <code>noncumulative</code> parameter.</p>
1709</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581710<dt class="hdlist1"><em>&lt;limit&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251711<dd>
1712<p>An integer parameter specifies a cut-off percent (3% by default).
1713Directories contributing less than this percentage of the changes
1714are not shown in the output.</p>
1715</dd>
1716</dl>
1717</div>
1718</div>
1719</div>
1720<div class="paragraph">
1721<p>Example: The following will count changed files, while ignoring
1722directories with less than 10% of the total amount of changed files,
1723and accumulating child directory counts in the parent directories:
1724<code>--dirstat=files,10,cumulative</code>.</p>
1725</div>
1726</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581727<dt class="hdlist1"><code>--cumulative</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251728<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581729<p>Synonym for <code>--dirstat=cumulative</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251730</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581731<dt class="hdlist1"><code>--dirstat-by-file</code>[<code>=</code><em>&lt;param&gt;</em><code>,..</code>.]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251732<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581733<p>Synonym for <code>--dirstat=files,</code><em>&lt;param&gt;</em><code>,..</code>..</p>
Junio C Hamanob96f40a2024-08-01 00:57:251734</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581735<dt class="hdlist1"><code>--summary</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251736<dd>
1737<p>Output a condensed summary of extended header information
1738such as creations, renames and mode changes.</p>
1739</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581740<dt class="hdlist1"><code>--patch-with-stat</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251741<dd>
Junio C Hamanodc392382024-10-11 18:57:291742<p>Synonym for <code>-p</code> <code>--stat</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251743</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581744<dt class="hdlist1"><code>-z</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251745<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581746<p>Separate the commits with <em>NUL</em>s instead of newlines.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251747<div class="paragraph">
1748<p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge
Junio C Hamano7f7e6a42024-12-04 04:45:581749pathnames and use <em>NUL</em>s as output field terminators.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251750</div>
1751<div class="paragraph">
1752<p>Without this option, pathnames with "unusual" characters are quoted as
1753explained for the configuration variable <code>core.quotePath</code> (see
1754<a href="git-config.html">git-config(1)</a>).</p>
1755</div>
1756</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581757<dt class="hdlist1"><code>--name-only</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251758<dd>
1759<p>Show only the name of each changed file in the post-image tree.
1760The file names are often encoded in UTF-8.
1761For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a>
1762manual page.</p>
1763</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581764<dt class="hdlist1"><code>--name-status</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251765<dd>
1766<p>Show only the name(s) and status of each changed file. See the description
1767of the <code>--diff-filter</code> option on what the status letters mean.
1768Just like <code>--name-only</code> the file names are often encoded in UTF-8.</p>
1769</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581770<dt class="hdlist1"><code>--submodule</code>[<code>=</code><em>&lt;format&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251771<dd>
1772<p>Specify how differences in submodules are shown. When specifying
Junio C Hamano7f7e6a42024-12-04 04:45:581773<code>--submodule=short</code> the <code>short</code> format is used. This format just
Junio C Hamanob96f40a2024-08-01 00:57:251774shows the names of the commits at the beginning and end of the range.
Junio C Hamano7f7e6a42024-12-04 04:45:581775When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <code>log</code>
Junio C Hamanob96f40a2024-08-01 00:57:251776format is used. This format lists the commits in the range like
1777<a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
Junio C Hamano7f7e6a42024-12-04 04:45:581778is specified, the <code>diff</code> format is used. This format shows an
Junio C Hamanob96f40a2024-08-01 00:57:251779inline diff of the changes in the submodule contents between the
Junio C Hamano7f7e6a42024-12-04 04:45:581780commit range. Defaults to <code>diff.submodule</code> or the <code>short</code> format
Junio C Hamanob96f40a2024-08-01 00:57:251781if the config option is unset.</p>
1782</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581783<dt class="hdlist1"><code>--color</code>[<code>=</code><em>&lt;when&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251784<dd>
1785<p>Show colored diff.
Junio C Hamano7f7e6a42024-12-04 04:45:581786<code>--color</code> (i.e. without <code>=</code><em>&lt;when&gt;</em>) is the same as <code>--color=always</code>.
Junio C Hamanob96f40a2024-08-01 00:57:251787<em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.</p>
1788</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581789<dt class="hdlist1"><code>--no-color</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251790<dd>
1791<p>Turn off colored diff.
1792It is the same as <code>--color=never</code>.</p>
1793</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581794<dt class="hdlist1"><code>--color-moved</code>[<code>=</code><em>&lt;mode&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251795<dd>
1796<p>Moved lines of code are colored differently.
Junio C Hamano7f7e6a42024-12-04 04:45:581797The <em>&lt;mode&gt;</em> defaults to <code>no</code> if the option is not given
1798and to <code>zebra</code> if the option with no mode is given.
Junio C Hamanob96f40a2024-08-01 00:57:251799The mode must be one of:</p>
1800<div class="openblock">
1801<div class="content">
1802<div class="dlist">
1803<dl>
Junio C Hamano7f7e6a42024-12-04 04:45:581804<dt class="hdlist1"><code>no</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251805<dd>
1806<p>Moved lines are not highlighted.</p>
1807</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581808<dt class="hdlist1"><code>default</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251809<dd>
1810<p>Is a synonym for <code>zebra</code>. This may change to a more sensible mode
1811in the future.</p>
1812</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581813<dt class="hdlist1"><code>plain</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251814<dd>
1815<p>Any line that is added in one location and was removed
Junio C Hamano7f7e6a42024-12-04 04:45:581816in another location will be colored with <code>color.diff.newMoved</code>.
1817Similarly <code>color.diff.oldMoved</code> will be used for removed lines
Junio C Hamanob96f40a2024-08-01 00:57:251818that are added somewhere else in the diff. This mode picks up any
1819moved line, but it is not very useful in a review to determine
1820if a block of code was moved without permutation.</p>
1821</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581822<dt class="hdlist1"><code>blocks</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251823<dd>
1824<p>Blocks of moved text of at least 20 alphanumeric characters
1825are detected greedily. The detected blocks are
Junio C Hamano7f7e6a42024-12-04 04:45:581826painted using either the <code>color.diff.</code>(<code>old</code>|<code>new</code>)<code>Moved</code> color.
Junio C Hamanob96f40a2024-08-01 00:57:251827Adjacent blocks cannot be told apart.</p>
1828</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581829<dt class="hdlist1"><code>zebra</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251830<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581831<p>Blocks of moved text are detected as in <code>blocks</code> mode. The blocks
1832are painted using either the <code>color.diff.</code>(<code>old</code>|<code>new</code>)<code>Moved</code> color or
1833<code>color.diff.</code>(<code>old</code>|<code>new</code>)<code>MovedAlternative</code>. The change between
Junio C Hamanob96f40a2024-08-01 00:57:251834the two colors indicates that a new block was detected.</p>
1835</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581836<dt class="hdlist1"><code>dimmed-zebra</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251837<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581838<p>Similar to <code>zebra</code>, but additional dimming of uninteresting parts
Junio C Hamanob96f40a2024-08-01 00:57:251839of moved code is performed. The bordering lines of two adjacent
1840blocks are considered interesting, the rest is uninteresting.
1841<code>dimmed_zebra</code> is a deprecated synonym.</p>
1842</dd>
1843</dl>
1844</div>
1845</div>
1846</div>
1847</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581848<dt class="hdlist1"><code>--no-color-moved</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251849<dd>
1850<p>Turn off move detection. This can be used to override configuration
1851settings. It is the same as <code>--color-moved=no</code>.</p>
1852</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581853<dt class="hdlist1"><code>--color-moved-ws=</code><em>&lt;mode&gt;</em><code>,..</code>.</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251854<dd>
1855<p>This configures how whitespace is ignored when performing the
1856move detection for <code>--color-moved</code>.
1857These modes can be given as a comma separated list:</p>
1858<div class="openblock">
1859<div class="content">
1860<div class="dlist">
1861<dl>
Junio C Hamano7f7e6a42024-12-04 04:45:581862<dt class="hdlist1"><code>no</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251863<dd>
1864<p>Do not ignore whitespace when performing move detection.</p>
1865</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581866<dt class="hdlist1"><code>ignore-space-at-eol</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251867<dd>
1868<p>Ignore changes in whitespace at EOL.</p>
1869</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581870<dt class="hdlist1"><code>ignore-space-change</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251871<dd>
1872<p>Ignore changes in amount of whitespace. This ignores whitespace
1873at line end, and considers all other sequences of one or
1874more whitespace characters to be equivalent.</p>
1875</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581876<dt class="hdlist1"><code>ignore-all-space</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251877<dd>
1878<p>Ignore whitespace when comparing lines. This ignores differences
1879even if one line has whitespace where the other line has none.</p>
1880</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581881<dt class="hdlist1"><code>allow-indentation-change</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251882<dd>
1883<p>Initially ignore any whitespace in the move detection, then
1884group the moved code blocks only into a block if the change in
1885whitespace is the same per line. This is incompatible with the
1886other modes.</p>
1887</dd>
1888</dl>
1889</div>
1890</div>
1891</div>
1892</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581893<dt class="hdlist1"><code>--no-color-moved-ws</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251894<dd>
1895<p>Do not ignore whitespace when performing move detection. This can be
1896used to override configuration settings. It is the same as
1897<code>--color-moved-ws=no</code>.</p>
1898</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581899<dt class="hdlist1"><code>--word-diff</code>[<code>=</code><em>&lt;mode&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251900<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581901<p>By default, words are delimited by whitespace; see
1902<code>--word-diff-regex</code> below. The <em>&lt;mode&gt;</em> defaults to <code>plain</code>, and
Junio C Hamanob96f40a2024-08-01 00:57:251903must be one of:</p>
1904<div class="openblock">
1905<div class="content">
1906<div class="dlist">
1907<dl>
Junio C Hamano7f7e6a42024-12-04 04:45:581908<dt class="hdlist1"><code>color</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251909<dd>
1910<p>Highlight changed words using only colors. Implies <code>--color</code>.</p>
1911</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581912<dt class="hdlist1"><code>plain</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251913<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581914<p>Show words as [<code>-removed-</code>] and {<code>added</code>}. Makes no
Junio C Hamanob96f40a2024-08-01 00:57:251915attempts to escape the delimiters if they appear in the input,
1916so the output may be ambiguous.</p>
1917</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581918<dt class="hdlist1"><code>porcelain</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251919<dd>
1920<p>Use a special line-based format intended for script
1921consumption. Added/removed/unchanged runs are printed in the
1922usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
1923character at the beginning of the line and extending to the
1924end of the line. Newlines in the input are represented by a
1925tilde <code>~</code> on a line of its own.</p>
1926</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581927<dt class="hdlist1"><code>none</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251928<dd>
1929<p>Disable word diff again.</p>
1930</dd>
1931</dl>
1932</div>
1933</div>
1934</div>
1935<div class="paragraph">
1936<p>Note that despite the name of the first mode, color is used to
1937highlight the changed parts in all modes if enabled.</p>
1938</div>
1939</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581940<dt class="hdlist1"><code>--word-diff-regex=</code><em>&lt;regex&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251941<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581942<p>Use <em>&lt;regex&gt;</em> to decide what a word is, instead of considering
Junio C Hamanob96f40a2024-08-01 00:57:251943runs of non-whitespace to be a word. Also implies
1944<code>--word-diff</code> unless it was already enabled.</p>
1945<div class="paragraph">
1946<p>Every non-overlapping match of the
Junio C Hamano7f7e6a42024-12-04 04:45:581947<em>&lt;regex&gt;</em> is considered a word. Anything between these matches is
Junio C Hamanob96f40a2024-08-01 00:57:251948considered whitespace and ignored(!) for the purposes of finding
Junio C Hamanodc392382024-10-11 18:57:291949differences. You may want to append |[<code>^</code>[<code>:space:</code>]] to your regular
Junio C Hamanob96f40a2024-08-01 00:57:251950expression to make sure that it matches all non-whitespace characters.
1951A match that contains a newline is silently truncated(!) at the
1952newline.</p>
1953</div>
1954<div class="paragraph">
1955<p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
1956and, correspondingly, show differences character by character.</p>
1957</div>
1958<div class="paragraph">
1959<p>The regex can also be set via a diff driver or configuration option, see
1960<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
1961overrides any diff driver or configuration setting. Diff drivers
1962override configuration settings.</p>
1963</div>
1964</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581965<dt class="hdlist1"><code>--color-words</code>[<code>=</code><em>&lt;regex&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:251966<dd>
1967<p>Equivalent to <code>--word-diff=color</code> plus (if a regex was
Junio C Hamanodc392382024-10-11 18:57:291968specified) <code>--word-diff-regex=</code><em>&lt;regex&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251969</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581970<dt class="hdlist1"><code>--no-renames</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251971<dd>
1972<p>Turn off rename detection, even when the configuration
1973file gives the default to do so.</p>
1974</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581975<dt class="hdlist1"><code>--</code>[<code>no-</code>]<code>rename-empty</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251976<dd>
1977<p>Whether to use empty blobs as rename source.</p>
1978</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581979<dt class="hdlist1"><code>--check</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251980<dd>
1981<p>Warn if changes introduce conflict markers or whitespace errors.
1982What are considered whitespace errors is controlled by <code>core.whitespace</code>
1983configuration. By default, trailing whitespaces (including
1984lines that consist solely of whitespaces) and a space character
1985that is immediately followed by a tab character inside the
1986initial indent of the line are considered whitespace errors.
1987Exits with non-zero status if problems are found. Not compatible
Junio C Hamano7f7e6a42024-12-04 04:45:581988with <code>--exit-code</code>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251989</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:581990<dt class="hdlist1"><code>--ws-error-highlight=</code><em>&lt;kind&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:251991<dd>
1992<p>Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
1993lines of the diff. Multiple values are separated by comma,
1994<code>none</code> resets previous values, <code>default</code> reset the list to
1995<code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
1996this option is not given, and the configuration variable
1997<code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
1998<code>new</code> lines are highlighted. The whitespace errors are colored
1999with <code>color.diff.whitespace</code>.</p>
2000</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582001<dt class="hdlist1"><code>--full-index</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252002<dd>
2003<p>Instead of the first handful of characters, show the full
2004pre- and post-image blob object names on the "index"
2005line when generating patch format output.</p>
2006</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582007<dt class="hdlist1"><code>--binary</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252008<dd>
2009<p>In addition to <code>--full-index</code>, output a binary diff that
2010can be applied with <code>git-apply</code>.
2011Implies <code>--patch</code>.</p>
2012</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582013<dt class="hdlist1"><code>--abbrev</code>[<code>=</code><em>&lt;n&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252014<dd>
2015<p>Instead of showing the full 40-byte hexadecimal object
2016name in diff-raw format output and diff-tree header
2017lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
2018hexdigits long that uniquely refers the object.
2019In diff-patch output format, <code>--full-index</code> takes higher
2020precedence, i.e. if <code>--full-index</code> is specified, full blob
2021names will be shown regardless of <code>--abbrev</code>.
Junio C Hamanodc392382024-10-11 18:57:292022Non default number of digits can be specified with <code>--abbrev=</code><em>&lt;n&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252023</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582024<dt class="hdlist1"><code>-B</code>[<em>&lt;n&gt;</em>][<code>/</code><em>&lt;m&gt;</em>]</dt>
2025<dt class="hdlist1"><code>--break-rewrites</code>[<code>=</code>[<em>&lt;n&gt;</em>][<code>/</code><em>&lt;m&gt;</em>]]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252026<dd>
2027<p>Break complete rewrite changes into pairs of delete and
2028create. This serves two purposes:</p>
2029<div class="paragraph">
2030<p>It affects the way a change that amounts to a total rewrite of a file
2031not as a series of deletion and insertion mixed together with a very
2032few lines that happen to match textually as the context, but as a
2033single deletion of everything old followed by a single insertion of
Junio C Hamano7f7e6a42024-12-04 04:45:582034everything new, and the number <em>&lt;m&gt;</em> controls this aspect of the <code>-B</code>
Junio C Hamanodc392382024-10-11 18:57:292035option (defaults to 60%). <code>-B/70</code>% specifies that less than 30% of the
Junio C Hamanob96f40a2024-08-01 00:57:252036original should remain in the result for Git to consider it a total
2037rewrite (i.e. otherwise the resulting patch will be a series of
2038deletion and insertion mixed together with context lines).</p>
2039</div>
2040<div class="paragraph">
Junio C Hamano7f7e6a42024-12-04 04:45:582041<p>When used with <code>-M</code>, a totally-rewritten file is also considered as the
2042source of a rename (usually <code>-M</code> only considers a file that disappeared
2043as the source of a rename), and the number <em>&lt;n&gt;</em> controls this aspect of
2044the <code>-B</code> option (defaults to 50%). <code>-B20</code>% specifies that a change with
Junio C Hamanob96f40a2024-08-01 00:57:252045addition and deletion compared to 20% or more of the file&#8217;s size are
2046eligible for being picked up as a possible source of a rename to
2047another file.</p>
2048</div>
2049</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582050<dt class="hdlist1"><code>-M</code>[<em>&lt;n&gt;</em>]</dt>
2051<dt class="hdlist1"><code>--find-renames</code>[<code>=</code><em>&lt;n&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252052<dd>
2053<p>If generating diffs, detect and report renames for each commit.
2054For following files across renames while traversing history, see
2055<code>--follow</code>.
Junio C Hamano7f7e6a42024-12-04 04:45:582056If <em>&lt;n&gt;</em> is specified, it is a threshold on the similarity
Junio C Hamanob96f40a2024-08-01 00:57:252057index (i.e. amount of addition/deletions compared to the
Junio C Hamanodc392382024-10-11 18:57:292058file&#8217;s size). For example, <code>-M90</code>% means Git should consider a
Junio C Hamanob96f40a2024-08-01 00:57:252059delete/add pair to be a rename if more than 90% of the file
Junio C Hamanodc392382024-10-11 18:57:292060hasn&#8217;t changed. Without a % sign, the number is to be read as
Junio C Hamanob96f40a2024-08-01 00:57:252061a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
Junio C Hamanodc392382024-10-11 18:57:2920620.5, and is thus the same as <code>-M50</code>%. Similarly, <code>-M05</code> is
2063the same as <code>-M5</code>%. To limit detection to exact renames, use
2064<code>-M100</code>%. The default similarity index is 50%.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252065</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582066<dt class="hdlist1"><code>-C</code>[<em>&lt;n&gt;</em>]</dt>
2067<dt class="hdlist1"><code>--find-copies</code>[<code>=</code><em>&lt;n&gt;</em>]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252068<dd>
2069<p>Detect copies as well as renames. See also <code>--find-copies-harder</code>.
Junio C Hamano7f7e6a42024-12-04 04:45:582070If <em>&lt;n&gt;</em> is specified, it has the same meaning as for <code>-M</code><em>&lt;n&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252071</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582072<dt class="hdlist1"><code>--find-copies-harder</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252073<dd>
2074<p>For performance reasons, by default, <code>-C</code> option finds copies only
2075if the original file of the copy was modified in the same
2076changeset. This flag makes the command
2077inspect unmodified files as candidates for the source of
2078copy. This is a very expensive operation for large
2079projects, so use it with caution. Giving more than one
2080<code>-C</code> option has the same effect.</p>
2081</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582082<dt class="hdlist1"><code>-D</code></dt>
2083<dt class="hdlist1"><code>--irreversible-delete</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252084<dd>
2085<p>Omit the preimage for deletes, i.e. print only the header but not
2086the diff between the preimage and <code>/dev/null</code>. The resulting patch
Junio C Hamanodc392382024-10-11 18:57:292087is not meant to be applied with <code>patch</code> or <code>git</code> <code>apply</code>; this is
Junio C Hamanob96f40a2024-08-01 00:57:252088solely for people who want to just concentrate on reviewing the
2089text after the change. In addition, the output obviously lacks
2090enough information to apply such a patch in reverse, even manually,
2091hence the name of the option.</p>
2092<div class="paragraph">
2093<p>When used together with <code>-B</code>, omit also the preimage in the deletion part
2094of a delete/create pair.</p>
2095</div>
2096</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582097<dt class="hdlist1"><code>-l</code><em>&lt;num&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252098<dd>
2099<p>The <code>-M</code> and <code>-C</code> options involve some preliminary steps that
2100can detect subsets of renames/copies cheaply, followed by an
2101exhaustive fallback portion that compares all remaining
2102unpaired destinations to all relevant sources. (For renames,
2103only remaining unpaired sources are relevant; for copies, all
2104original sources are relevant.) For N sources and
2105destinations, this exhaustive check is O(N^2). This option
2106prevents the exhaustive portion of rename/copy detection from
2107running if the number of source/destination files involved
Junio C Hamano7f7e6a42024-12-04 04:45:582108exceeds the specified number. Defaults to <code>diff.renameLimit</code>.
Junio C Hamanob96f40a2024-08-01 00:57:252109Note that a value of 0 is treated as unlimited.</p>
2110</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582111<dt class="hdlist1"><code>--diff-filter=</code>[(<code>A</code>|<code>C</code>|<code>D</code>|<code>M</code>|<code>R</code>|<code>T</code>|<code>U</code>|<code>X</code>|<code>B</code>)<code>...</code>[*]]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252112<dd>
2113<p>Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
2114Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
2115type (i.e. regular file, symlink, submodule, &#8230;&#8203;) changed (<code>T</code>),
2116are Unmerged (<code>U</code>), are
2117Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
2118Any combination of the filter characters (including none) can be used.
Junio C Hamanodc392382024-10-11 18:57:292119When * (All-or-none) is added to the combination, all
Junio C Hamanob96f40a2024-08-01 00:57:252120paths are selected if there is any file that matches
2121other criteria in the comparison; if there is no file
2122that matches other criteria, nothing is selected.</p>
2123<div class="paragraph">
2124<p>Also, these upper-case letters can be downcased to exclude. E.g.
2125<code>--diff-filter=ad</code> excludes added and deleted paths.</p>
2126</div>
2127<div class="paragraph">
2128<p>Note that not all diffs can feature all types. For instance, copied and
2129renamed entries cannot appear if detection for those types is disabled.</p>
2130</div>
2131</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582132<dt class="hdlist1"><code>-S</code><em>&lt;string&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252133<dd>
2134<p>Look for differences that change the number of occurrences of
Junio C Hamano7f7e6a42024-12-04 04:45:582135the specified <em>&lt;string&gt;</em> (i.e. addition/deletion) in a file.
Junio C Hamanob96f40a2024-08-01 00:57:252136Intended for the scripter&#8217;s use.</p>
2137<div class="paragraph">
2138<p>It is useful when you&#8217;re looking for an exact block of code (like a
2139struct), and want to know the history of that block since it first
2140came into being: use the feature iteratively to feed the interesting
2141block in the preimage back into <code>-S</code>, and keep going until you get the
2142very first version of the block.</p>
2143</div>
2144<div class="paragraph">
2145<p>Binary files are searched as well.</p>
2146</div>
2147</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582148<dt class="hdlist1"><code>-G</code><em>&lt;regex&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252149<dd>
2150<p>Look for differences whose patch text contains added/removed
Junio C Hamano7f7e6a42024-12-04 04:45:582151lines that match <em>&lt;regex&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252152<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:292153<p>To illustrate the difference between <code>-S</code><em>&lt;regex&gt;</em> <code>--pickaxe-regex</code> and
2154<code>-G</code><em>&lt;regex&gt;</em>, consider a commit with the following diff in the same
Junio C Hamanob96f40a2024-08-01 00:57:252155file:</p>
2156</div>
2157<div class="listingblock">
2158<div class="content">
2159<pre>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
2160...
2161- hit = frotz(nitfol, mf2.ptr, 1, 0);</pre>
2162</div>
2163</div>
2164<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:292165<p>While <code>git</code> <code>log</code> <code>-G</code>"frotz\(<code>nitfol</code>" will show this commit, <code>git</code> <code>log</code>
2166<code>-S</code>"frotz\(<code>nitfol</code>" <code>--pickaxe-regex</code> will not (because the number of
Junio C Hamanob96f40a2024-08-01 00:57:252167occurrences of that string did not change).</p>
2168</div>
2169<div class="paragraph">
2170<p>Unless <code>--text</code> is supplied patches of binary files without a textconv
2171filter will be ignored.</p>
2172</div>
2173<div class="paragraph">
2174<p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
2175information.</p>
2176</div>
2177</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582178<dt class="hdlist1"><code>--find-object=</code><em>&lt;object-id&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252179<dd>
2180<p>Look for differences that change the number of occurrences of
2181the specified object. Similar to <code>-S</code>, just the argument is different
2182in that it doesn&#8217;t search for a specific string but for a specific
2183object id.</p>
2184<div class="paragraph">
2185<p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
2186<code>git-log</code> to also find trees.</p>
2187</div>
2188</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582189<dt class="hdlist1"><code>--pickaxe-all</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252190<dd>
2191<p>When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
2192changeset, not just the files that contain the change
Junio C Hamano7f7e6a42024-12-04 04:45:582193in <em>&lt;string&gt;</em>.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252194</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582195<dt class="hdlist1"><code>--pickaxe-regex</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252196<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582197<p>Treat the <em>&lt;string&gt;</em> given to <code>-S</code> as an extended POSIX regular
Junio C Hamanob96f40a2024-08-01 00:57:252198expression to match.</p>
2199</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582200<dt class="hdlist1"><code>-O</code><em>&lt;orderfile&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252201<dd>
2202<p>Control the order in which files appear in the output.
2203This overrides the <code>diff.orderFile</code> configuration variable
2204(see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
2205use <code>-O/dev/null</code>.</p>
2206<div class="paragraph">
2207<p>The output order is determined by the order of glob patterns in
Junio C Hamano7f7e6a42024-12-04 04:45:582208<em>&lt;orderfile&gt;</em>.
Junio C Hamanob96f40a2024-08-01 00:57:252209All files with pathnames that match the first pattern are output
2210first, all files with pathnames that match the second pattern (but not
2211the first) are output next, and so on.
2212All files with pathnames that do not match any pattern are output
2213last, as if there was an implicit match-all pattern at the end of the
2214file.
2215If multiple pathnames have the same rank (they match the same pattern
2216but no earlier patterns), their output order relative to each other is
2217the normal order.</p>
2218</div>
2219<div class="paragraph">
Junio C Hamano7f7e6a42024-12-04 04:45:582220<p><em>&lt;orderfile&gt;</em> is parsed as follows:</p>
Junio C Hamanob96f40a2024-08-01 00:57:252221</div>
2222<div class="openblock">
2223<div class="content">
2224<div class="ulist">
2225<ul>
2226<li>
2227<p>Blank lines are ignored, so they can be used as separators for
2228readability.</p>
2229</li>
2230<li>
Junio C Hamanodc392382024-10-11 18:57:292231<p>Lines starting with a hash ("#") are ignored, so they can be used
2232for comments. Add a backslash ("\") to the beginning of the
Junio C Hamanob96f40a2024-08-01 00:57:252233pattern if it starts with a hash.</p>
2234</li>
2235<li>
2236<p>Each other line contains a single pattern.</p>
2237</li>
2238</ul>
2239</div>
2240</div>
2241</div>
2242<div class="paragraph">
2243<p>Patterns have the same syntax and semantics as patterns used for
Junio C Hamano7f7e6a42024-12-04 04:45:582244<code>fnmatch</code>(3) without the <code>FNM_PATHNAME</code> flag, except a pathname also
Junio C Hamanob96f40a2024-08-01 00:57:252245matches a pattern if removing any number of the final pathname
Junio C Hamanodc392382024-10-11 18:57:292246components matches the pattern. For example, the pattern "<code>foo</code>*bar"
Junio C Hamanob96f40a2024-08-01 00:57:252247matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p>
2248</div>
2249</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582250<dt class="hdlist1"><code>--skip-to=</code><em>&lt;file&gt;</em></dt>
2251<dt class="hdlist1"><code>--rotate-to=</code><em>&lt;file&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252252<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582253<p>Discard the files before the named <em>&lt;file&gt;</em> from the output
Junio C Hamanob96f40a2024-08-01 00:57:252254(i.e. <em>skip to</em>), or move them to the end of the output
2255(i.e. <em>rotate to</em>). These options were invented primarily for the use
Junio C Hamanodc392382024-10-11 18:57:292256of the <code>git</code> <code>difftool</code> command, and may not be very useful
Junio C Hamanob96f40a2024-08-01 00:57:252257otherwise.</p>
2258</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582259<dt class="hdlist1"><code>-R</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252260<dd>
2261<p>Swap two inputs; that is, show differences from index or
2262on-disk file to tree contents.</p>
2263</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582264<dt class="hdlist1"><code>--relative</code>[<code>=</code><em>&lt;path&gt;</em>]</dt>
2265<dt class="hdlist1"><code>--no-relative</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252266<dd>
2267<p>When run from a subdirectory of the project, it can be
2268told to exclude changes outside the directory and show
2269pathnames relative to it with this option. When you are
2270not in a subdirectory (e.g. in a bare repository), you
2271can name which subdirectory to make the output relative
Junio C Hamano7f7e6a42024-12-04 04:45:582272to by giving a <em>&lt;path&gt;</em> as an argument.
Junio C Hamanob96f40a2024-08-01 00:57:252273<code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
2274option and previous <code>--relative</code>.</p>
2275</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582276<dt class="hdlist1"><code>-a</code></dt>
2277<dt class="hdlist1"><code>--text</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252278<dd>
2279<p>Treat all files as text.</p>
2280</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582281<dt class="hdlist1"><code>--ignore-cr-at-eol</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252282<dd>
2283<p>Ignore carriage-return at the end of line when doing a comparison.</p>
2284</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582285<dt class="hdlist1"><code>--ignore-space-at-eol</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252286<dd>
2287<p>Ignore changes in whitespace at EOL.</p>
2288</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582289<dt class="hdlist1"><code>-b</code></dt>
2290<dt class="hdlist1"><code>--ignore-space-change</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252291<dd>
2292<p>Ignore changes in amount of whitespace. This ignores whitespace
2293at line end, and considers all other sequences of one or
2294more whitespace characters to be equivalent.</p>
2295</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582296<dt class="hdlist1"><code>-w</code></dt>
2297<dt class="hdlist1"><code>--ignore-all-space</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252298<dd>
2299<p>Ignore whitespace when comparing lines. This ignores
2300differences even if one line has whitespace where the other
2301line has none.</p>
2302</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582303<dt class="hdlist1"><code>--ignore-blank-lines</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252304<dd>
2305<p>Ignore changes whose lines are all blank.</p>
2306</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582307<dt class="hdlist1"><code>-I</code><em>&lt;regex&gt;</em></dt>
2308<dt class="hdlist1"><code>--ignore-matching-lines=</code><em>&lt;regex&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252309<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582310<p>Ignore changes whose all lines match <em>&lt;regex&gt;</em>. This option may
Junio C Hamanob96f40a2024-08-01 00:57:252311be specified more than once.</p>
2312</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582313<dt class="hdlist1"><code>--inter-hunk-context=</code><em>&lt;number&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252314<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582315<p>Show the context between diff hunks, up to the specified <em>&lt;number&gt;</em>
Junio C Hamanob96f40a2024-08-01 00:57:252316of lines, thereby fusing hunks that are close to each other.
2317Defaults to <code>diff.interHunkContext</code> or 0 if the config option
2318is unset.</p>
2319</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582320<dt class="hdlist1"><code>-W</code></dt>
2321<dt class="hdlist1"><code>--function-context</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252322<dd>
2323<p>Show whole function as context lines for each change.
2324The function names are determined in the same way as
Junio C Hamano7f7e6a42024-12-04 04:45:582325<code>git</code> <code>diff</code> works out patch hunk headers (see "Defining a
2326custom hunk-header" in <a href="gitattributes.html">gitattributes(5)</a>).</p>
Junio C Hamanob96f40a2024-08-01 00:57:252327</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582328<dt class="hdlist1"><code>--ext-diff</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252329<dd>
2330<p>Allow an external diff helper to be executed. If you set an
2331external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
2332to use this option with <a href="git-log.html">git-log(1)</a> and friends.</p>
2333</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582334<dt class="hdlist1"><code>--no-ext-diff</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252335<dd>
2336<p>Disallow external diff drivers.</p>
2337</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582338<dt class="hdlist1"><code>--textconv</code></dt>
2339<dt class="hdlist1"><code>--no-textconv</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252340<dd>
2341<p>Allow (or disallow) external text conversion filters to be run
2342when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
2343details. Because textconv filters are typically a one-way
2344conversion, the resulting diff is suitable for human
2345consumption, but cannot be applied. For this reason, textconv
2346filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
2347<a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
2348diff plumbing commands.</p>
2349</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582350<dt class="hdlist1"><code>--ignore-submodules</code>[<code>=</code>(<code>none</code>|<code>untracked</code>|<code>dirty</code>|<code>all</code>)]</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252351<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582352<p>Ignore changes to submodules in the diff generation. <code>all</code> is the default.
2353Using <code>none</code> will consider the submodule modified when it either contains
2354untracked or modified files or its <code>HEAD</code> differs from the commit recorded
Junio C Hamanob96f40a2024-08-01 00:57:252355in the superproject and can be used to override any settings of the
Junio C Hamano7f7e6a42024-12-04 04:45:582356<code>ignore</code> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
2357<code>untracked</code> is used submodules are not considered dirty when they only
Junio C Hamanob96f40a2024-08-01 00:57:252358contain untracked content (but they are still scanned for modified
Junio C Hamano7f7e6a42024-12-04 04:45:582359content). Using <code>dirty</code> ignores all changes to the work tree of submodules,
Junio C Hamanob96f40a2024-08-01 00:57:252360only changes to the commits stored in the superproject are shown (this was
Junio C Hamano7f7e6a42024-12-04 04:45:582361the behavior until 1.7.0). Using <code>all</code> hides all changes to submodules.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252362</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582363<dt class="hdlist1"><code>--src-prefix=</code><em>&lt;prefix&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252364<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582365<p>Show the given source <em>&lt;prefix&gt;</em> instead of "a/".</p>
Junio C Hamanob96f40a2024-08-01 00:57:252366</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582367<dt class="hdlist1"><code>--dst-prefix=</code><em>&lt;prefix&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252368<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582369<p>Show the given destination <em>&lt;prefix&gt;</em> instead of "b/".</p>
Junio C Hamanob96f40a2024-08-01 00:57:252370</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582371<dt class="hdlist1"><code>--no-prefix</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252372<dd>
2373<p>Do not show any source or destination prefix.</p>
2374</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582375<dt class="hdlist1"><code>--default-prefix</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252376<dd>
2377<p>Use the default source and destination prefixes ("a/" and "b/").
2378This overrides configuration variables such as <code>diff.noprefix</code>,
2379<code>diff.srcPrefix</code>, <code>diff.dstPrefix</code>, and <code>diff.mnemonicPrefix</code>
Junio C Hamano7f7e6a42024-12-04 04:45:582380(see <a href="git-config.html">git-config(1)</a>).</p>
Junio C Hamanob96f40a2024-08-01 00:57:252381</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582382<dt class="hdlist1"><code>--line-prefix=</code><em>&lt;prefix&gt;</em></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252383<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582384<p>Prepend an additional <em>&lt;prefix&gt;</em> to every line of output.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252385</dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582386<dt class="hdlist1"><code>--ita-invisible-in-index</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252387<dd>
Junio C Hamano7f7e6a42024-12-04 04:45:582388<p>By default entries added by <code>git</code> <code>add</code> <code>-N</code> appear as an existing
2389empty file in <code>git</code> <code>diff</code> and a new file in <code>git</code> <code>diff</code> <code>--cached</code>.
2390This option makes the entry appear as a new file in <code>git</code> <code>diff</code>
2391and non-existent in <code>git</code> <code>diff</code> <code>--cached</code>. This option could be
Junio C Hamanob96f40a2024-08-01 00:57:252392reverted with <code>--ita-visible-in-index</code>. Both options are
2393experimental and could be removed in future.</p>
2394</dd>
2395</dl>
2396</div>
2397<div class="paragraph">
2398<p>For more detailed explanation on these common options, see also
2399<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p>
2400</div>
2401</div>
2402</div>
2403<div class="sect1">
2404<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
2405<div class="sectionbody">
2406<div class="paragraph">
2407<p>Running
2408<a href="git-diff.html">git-diff(1)</a>,
2409<a href="git-log.html">git-log(1)</a>,
2410<a href="git-show.html">git-show(1)</a>,
2411<a href="git-diff-index.html">git-diff-index(1)</a>,
2412<a href="git-diff-tree.html">git-diff-tree(1)</a>, or
2413<a href="git-diff-files.html">git-diff-files(1)</a>
2414with the <code>-p</code> option produces patch text.
2415You can customize the creation of patch text via the
2416<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
2417(see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p>
2418</div>
2419<div class="paragraph">
Junio C Hamano7f7e6a42024-12-04 04:45:582420<p>What the <code>-p</code> option produces is slightly different from the traditional
Junio C Hamanob96f40a2024-08-01 00:57:252421diff format:</p>
2422</div>
2423<div class="olist arabic">
2424<ol class="arabic">
2425<li>
2426<p>It is preceded by a "git diff" header that looks like this:</p>
2427<div class="literalblock">
2428<div class="content">
2429<pre>diff --git a/file1 b/file2</pre>
2430</div>
2431</div>
2432<div class="paragraph">
2433<p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
2434involved. Especially, even for a creation or a deletion,
2435<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p>
2436</div>
2437<div class="paragraph">
2438<p>When a rename/copy is involved, <code>file1</code> and <code>file2</code> show the
2439name of the source file of the rename/copy and the name of
2440the file that the rename/copy produces, respectively.</p>
2441</div>
2442</li>
2443<li>
2444<p>It is followed by one or more extended header lines:</p>
Junio C Hamano7f7e6a42024-12-04 04:45:582445<div class="verseblock">
2446<pre class="content"><code>old</code> <code>mode</code> <em>&lt;mode&gt;</em>
2447<code>new</code> <code>mode</code> <em>&lt;mode&gt;</em>
2448<code>deleted</code> <code>file</code> <code>mode</code> <em>&lt;mode&gt;</em>
2449<code>new</code> <code>file</code> <code>mode</code> <em>&lt;mode&gt;</em>
2450<code>copy</code> <code>from</code> <em>&lt;path&gt;</em>
2451<code>copy</code> <code>to</code> <em>&lt;path&gt;</em>
2452<code>rename</code> <code>from</code> <em>&lt;path&gt;</em>
2453<code>rename</code> <code>to</code> <em>&lt;path&gt;</em>
2454<code>similarity</code> <code>index</code> <em>&lt;number&gt;</em>
2455<code>dissimilarity</code> <code>index</code> <em>&lt;number&gt;</em>
2456<code>index</code> <em>&lt;hash&gt;</em>`..`<em>&lt;hash&gt;</em> <em>&lt;mode&gt;</em></pre>
Junio C Hamanob96f40a2024-08-01 00:57:252457</div>
2458<div class="paragraph">
Junio C Hamano7f7e6a42024-12-04 04:45:582459<p>File modes <em>&lt;mode&gt;</em> are printed as 6-digit octal numbers including the file type
Junio C Hamanob96f40a2024-08-01 00:57:252460and file permission bits.</p>
2461</div>
2462<div class="paragraph">
2463<p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p>
2464</div>
2465<div class="paragraph">
2466<p>The similarity index is the percentage of unchanged lines, and
2467the dissimilarity index is the percentage of changed lines. It
2468is a rounded down integer, followed by a percent sign. The
2469similarity index value of 100% is thus reserved for two equal
2470files, while 100% dissimilarity means that no line from the old
2471file made it into the new one.</p>
2472</div>
2473<div class="paragraph">
2474<p>The index line includes the blob object names before and after the change.
Junio C Hamano7f7e6a42024-12-04 04:45:582475The <em>&lt;mode&gt;</em> is included if the file mode does not change; otherwise,
Junio C Hamanob96f40a2024-08-01 00:57:252476separate lines indicate the old and the new mode.</p>
2477</div>
2478</li>
2479<li>
2480<p>Pathnames with "unusual" characters are quoted as explained for
2481the configuration variable <code>core.quotePath</code> (see
2482<a href="git-config.html">git-config(1)</a>).</p>
2483</li>
2484<li>
2485<p>All the <code>file1</code> files in the output refer to files before the
2486commit, and all the <code>file2</code> files refer to files after the commit.
2487It is incorrect to apply each change to each file sequentially. For
2488example, this patch will swap a and b:</p>
2489<div class="literalblock">
2490<div class="content">
2491<pre>diff --git a/a b/b
2492rename from a
2493rename to b
2494diff --git a/b b/a
2495rename from b
2496rename to a</pre>
2497</div>
2498</div>
2499</li>
2500<li>
2501<p>Hunk headers mention the name of the function to which the hunk
2502applies. See "Defining a custom hunk-header" in
2503<a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor this to
2504specific languages.</p>
2505</li>
2506</ol>
2507</div>
2508</div>
2509</div>
2510<div class="sect1">
2511<h2 id="_combined_diff_format">Combined diff format</h2>
2512<div class="sectionbody">
2513<div class="paragraph">
2514<p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
2515produce a <em>combined diff</em> when showing a merge. This is the default
2516format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2517<a href="git-show.html">git-show(1)</a>. Note also that you can give suitable
2518<code>--diff-merges</code> option to any of these commands to force generation of
2519diffs in a specific format.</p>
2520</div>
2521<div class="paragraph">
2522<p>A "combined diff" format looks like this:</p>
2523</div>
2524<div class="listingblock">
2525<div class="content">
2526<pre>diff --combined describe.c
2527index fabadb8,cc95eb0..4866510
2528--- a/describe.c
2529+++ b/describe.c
2530@@@ -98,20 -98,12 +98,20 @@@
2531 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2532 }
2533
2534- static void describe(char *arg)
2535 -static void describe(struct commit *cmit, int last_one)
2536++static void describe(char *arg, int last_one)
2537 {
2538 + unsigned char sha1[20];
2539 + struct commit *cmit;
2540 struct commit_list *list;
2541 static int initialized = 0;
2542 struct commit_name *n;
2543
2544 + if (get_sha1(arg, sha1) &lt; 0)
2545 + usage(describe_usage);
2546 + cmit = lookup_commit_reference(sha1);
2547 + if (!cmit)
2548 + usage(describe_usage);
2549 +
2550 if (!initialized) {
2551 initialized = 1;
2552 for_each_ref(get_name);</pre>
2553</div>
2554</div>
2555<div class="olist arabic">
2556<ol class="arabic">
2557<li>
2558<p>It is preceded by a "git diff" header, that looks like
2559this (when the <code>-c</code> option is used):</p>
2560<div class="literalblock">
2561<div class="content">
2562<pre>diff --combined file</pre>
2563</div>
2564</div>
2565<div class="paragraph">
2566<p>or like this (when the <code>--cc</code> option is used):</p>
2567</div>
2568<div class="literalblock">
2569<div class="content">
2570<pre>diff --cc file</pre>
2571</div>
2572</div>
2573</li>
2574<li>
2575<p>It is followed by one or more extended header lines
2576(this example shows a merge with two parents):</p>
Junio C Hamano7f7e6a42024-12-04 04:45:582577<div class="verseblock">
2578<pre class="content"><code>index</code> <em>&lt;hash&gt;</em><code>,</code><em>&lt;hash&gt;</em>`..<code>__</code><em>&lt;hash&gt;</em><code>__</code>
2579{empty}`mode <em>&lt;mode&gt;</em><code>,</code><em>&lt;mode&gt;</em>``..``<em>&lt;mode&gt;</em>
2580<code>new</code> <code>file</code> <code>mode</code> <em>&lt;mode&gt;</em>
2581<code>deleted</code> <code>file</code> <code>mode</code> <em>&lt;mode&gt;</em><code>,</code><em>&lt;mode&gt;</em></pre>
Junio C Hamanob96f40a2024-08-01 00:57:252582</div>
2583<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:292584<p>The <code>mode</code> <em>&lt;mode&gt;</em><code>,</code><em>&lt;mode&gt;</em><code>..</code><em>&lt;mode&gt;</em> line appears only if at least one of
Junio C Hamanob96f40a2024-08-01 00:57:252585the &lt;mode&gt; is different from the rest. Extended headers with
2586information about detected content movement (renames and
2587copying detection) are designed to work with the diff of two
Junio C Hamano7f7e6a42024-12-04 04:45:582588<em>&lt;tree-ish&gt;</em> and are not used by combined diff format.</p>
Junio C Hamanob96f40a2024-08-01 00:57:252589</div>
2590</li>
2591<li>
2592<p>It is followed by a two-line from-file/to-file header:</p>
2593<div class="literalblock">
2594<div class="content">
2595<pre>--- a/file
2596+++ b/file</pre>
2597</div>
2598</div>
2599<div class="paragraph">
2600<p>Similar to the two-line header for the traditional <em>unified</em> diff
2601format, <code>/dev/null</code> is used to signal created or deleted
2602files.</p>
2603</div>
2604<div class="paragraph">
2605<p>However, if the --combined-all-paths option is provided, instead of a
2606two-line from-file/to-file, you get an N+1 line from-file/to-file header,
2607where N is the number of parents in the merge commit:</p>
2608</div>
2609<div class="literalblock">
2610<div class="content">
2611<pre>--- a/file
2612--- a/file
2613--- a/file
2614+++ b/file</pre>
2615</div>
2616</div>
2617<div class="paragraph">
2618<p>This extended format can be useful if rename or copy detection is
2619active, to allow you to see the original name of the file in different
2620parents.</p>
2621</div>
2622</li>
2623<li>
2624<p>Chunk header format is modified to prevent people from
Junio C Hamanodc392382024-10-11 18:57:292625accidentally feeding it to <code>patch</code> <code>-p1</code>. Combined diff format
Junio C Hamanob96f40a2024-08-01 00:57:252626was created for review of merge commit changes, and was not
2627meant to be applied. The change is similar to the change in the
2628extended <em>index</em> header:</p>
2629<div class="literalblock">
2630<div class="content">
2631<pre>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</pre>
2632</div>
2633</div>
2634<div class="paragraph">
2635<p>There are (number of parents + 1) <code>@</code> characters in the chunk
2636header for combined diff format.</p>
2637</div>
2638</li>
2639</ol>
2640</div>
2641<div class="paragraph">
2642<p>Unlike the traditional <em>unified</em> diff format, which shows two
2643files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
Junio C Hamanodc392382024-10-11 18:57:292644added to B), or " " (space&#8201;&#8212;&#8201;unchanged) prefix, this format
Junio C Hamanob96f40a2024-08-01 00:57:252645compares two or more files file1, file2,&#8230;&#8203; with one file X, and
2646shows how X differs from each of fileN. One column for each of
2647fileN is prepended to the output line to note how X&#8217;s line is
2648different from it.</p>
2649</div>
2650<div class="paragraph">
2651<p>A <code>-</code> character in the column N means that the line appears in
2652fileN but it does not appear in the result. A <code>+</code> character
2653in the column N means that the line appears in the result,
2654and fileN does not have that line (in other words, the line was
2655added, from the point of view of that parent).</p>
2656</div>
2657<div class="paragraph">
2658<p>In the above example output, the function signature was changed
2659from both files (hence two <code>-</code> removals from both file1 and
2660file2, plus <code>++</code> to mean one line that was added does not appear
2661in either file1 or file2). Also, eight other lines are the same
2662from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p>
2663</div>
2664<div class="paragraph">
Junio C Hamanodc392382024-10-11 18:57:292665<p>When shown by <code>git</code> <code>diff-tree</code> <code>-c</code>, it compares the parents of a
Junio C Hamanob96f40a2024-08-01 00:57:252666merge commit with the merge result (i.e. file1..fileN are the
Junio C Hamanodc392382024-10-11 18:57:292667parents). When shown by <code>git</code> <code>diff-files</code> <code>-c</code>, it compares the
Junio C Hamanob96f40a2024-08-01 00:57:252668two unresolved merge parents with the working tree file
2669(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2670"their version").</p>
2671</div>
2672</div>
2673</div>
2674<div class="sect1">
2675<h2 id="_examples">EXAMPLES</h2>
2676<div class="sectionbody">
2677<div class="dlist">
2678<dl>
Junio C Hamanodc392382024-10-11 18:57:292679<dt class="hdlist1"><code>git</code> <code>show</code> <code>v1.0.0</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252680<dd>
2681<p>Shows the tag <code>v1.0.0</code>, along with the object the tag
2682points at.</p>
2683</dd>
Junio C Hamanodc392382024-10-11 18:57:292684<dt class="hdlist1"><code>git</code> <code>show</code> <code>v1.0.0^</code>{tree}</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252685<dd>
2686<p>Shows the tree pointed to by the tag <code>v1.0.0</code>.</p>
2687</dd>
Junio C Hamanodc392382024-10-11 18:57:292688<dt class="hdlist1"><code>git</code> <code>show</code> <code>-s</code> <code>--format=</code>%s <code>v1.0.0^</code>{commit}</dt>
Junio C Hamanob96f40a2024-08-01 00:57:252689<dd>
2690<p>Shows the subject of the commit pointed to by the
2691tag <code>v1.0.0</code>.</p>
2692</dd>
Junio C Hamanodc392382024-10-11 18:57:292693<dt class="hdlist1"><code>git</code> <code>show</code> <code>next~10:Documentation/README</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252694<dd>
2695<p>Shows the contents of the file <code>Documentation/README</code> as
2696they were current in the 10th last commit of the branch
2697<code>next</code>.</p>
2698</dd>
Junio C Hamanodc392382024-10-11 18:57:292699<dt class="hdlist1"><code>git</code> <code>show</code> <code>master:Makefile</code> <code>master:t/Makefile</code></dt>
Junio C Hamanob96f40a2024-08-01 00:57:252700<dd>
2701<p>Concatenates the contents of said Makefiles in the head
2702of the branch <code>master</code>.</p>
2703</dd>
2704</dl>
2705</div>
2706</div>
2707</div>
2708<div class="sect1">
2709<h2 id="_discussion">DISCUSSION</h2>
2710<div class="sectionbody">
2711<div class="paragraph">
2712<p>Git is to some extent character encoding agnostic.</p>
2713</div>
2714<div class="ulist">
2715<ul>
2716<li>
2717<p>The contents of the blob objects are uninterpreted sequences
2718of bytes. There is no encoding translation at the core
2719level.</p>
2720</li>
2721<li>
2722<p>Path names are encoded in UTF-8 normalization form C. This
2723applies to tree objects, the index file, ref names, as well as
2724path names in command line arguments, environment variables
Junio C Hamanodc392382024-10-11 18:57:292725and config files (.<code>git/config</code> (see <a href="git-config.html">git-config(1)</a>),
Junio C Hamanob96f40a2024-08-01 00:57:252726<a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
2727<a href="gitmodules.html">gitmodules(5)</a>).</p>
2728<div class="paragraph">
2729<p>Note that Git at the core level treats path names simply as
2730sequences of non-NUL bytes, there are no path name encoding
2731conversions (except on Mac and Windows). Therefore, using
2732non-ASCII path names will mostly work even on platforms and file
2733systems that use legacy extended ASCII encodings. However,
2734repositories created on such systems will not work properly on
2735UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
2736Additionally, many Git-based tools simply assume path names to
2737be UTF-8 and will fail to display other encodings correctly.</p>
2738</div>
2739</li>
2740<li>
2741<p>Commit log messages are typically encoded in UTF-8, but other
2742extended ASCII encodings are also supported. This includes
2743ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
2744EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
2745EUC-x, CP9xx etc.).</p>
2746</li>
2747</ul>
2748</div>
2749<div class="paragraph">
2750<p>Although we encourage that the commit log messages are encoded
2751in UTF-8, both the core and Git Porcelain are designed not to
2752force UTF-8 on projects. If all participants of a particular
2753project find it more convenient to use legacy encodings, Git
2754does not forbid it. However, there are a few things to keep in
2755mind.</p>
2756</div>
2757<div class="olist arabic">
2758<ol class="arabic">
2759<li>
Junio C Hamano796624e2025-01-29 23:44:542760<p><code>git</code> <code>commit</code> and <code>git</code> <code>commit-tree</code> issue
Junio C Hamanob96f40a2024-08-01 00:57:252761a warning if the commit log message given to it does not look
2762like a valid UTF-8 string, unless you explicitly say your
2763project uses a legacy encoding. The way to say this is to
Junio C Hamanodc392382024-10-11 18:57:292764have <code>i18n.commitEncoding</code> in .<code>git/config</code> file, like this:</p>
Junio C Hamanob96f40a2024-08-01 00:57:252765<div class="listingblock">
2766<div class="content">
2767<pre>[i18n]
2768 commitEncoding = ISO-8859-1</pre>
2769</div>
2770</div>
2771<div class="paragraph">
2772<p>Commit objects created with the above setting record the value
2773of <code>i18n.commitEncoding</code> in their <code>encoding</code> header. This is to
2774help other people who look at them later. Lack of this header
2775implies that the commit log message is encoded in UTF-8.</p>
2776</div>
2777</li>
2778<li>
Junio C Hamano796624e2025-01-29 23:44:542779<p><code>git</code> <code>log</code>, <code>git</code> <code>show</code>, <code>git</code> <code>blame</code> and friends look at the
Junio C Hamanob96f40a2024-08-01 00:57:252780<code>encoding</code> header of a commit object, and try to re-code the
2781log message into UTF-8 unless otherwise specified. You can
2782specify the desired output encoding with
Junio C Hamanodc392382024-10-11 18:57:292783<code>i18n.logOutputEncoding</code> in .<code>git/config</code> file, like this:</p>
Junio C Hamanob96f40a2024-08-01 00:57:252784<div class="listingblock">
2785<div class="content">
2786<pre>[i18n]
2787 logOutputEncoding = ISO-8859-1</pre>
2788</div>
2789</div>
2790<div class="paragraph">
2791<p>If you do not have this configuration variable, the value of
2792<code>i18n.commitEncoding</code> is used instead.</p>
2793</div>
2794</li>
2795</ol>
2796</div>
2797<div class="paragraph">
2798<p>Note that we deliberately chose not to re-code the commit log
2799message when a commit is made to force UTF-8 at the commit
2800object level, because re-coding to UTF-8 is not necessarily a
2801reversible operation.</p>
2802</div>
2803</div>
2804</div>
2805<div class="sect1">
2806<h2 id="_git">GIT</h2>
2807<div class="sectionbody">
2808<div class="paragraph">
2809<p>Part of the <a href="git.html">git(1)</a> suite</p>
2810</div>
2811</div>
2812</div>
2813</div>
2814<div id="footer">
2815<div id="footer-text">
Junio C Hamanod6a33e42025-02-18 23:45:112816Last updated 2025-02-14 21:38:14 -0800
Junio C Hamanob96f40a2024-08-01 00:57:252817</div>
2818</div>
2819</body>
2820</html>