2 <html xmlns=
"http://www.w3.org/1999/xhtml" lang=
"en">
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"/>
7 <meta name=
"generator" content=
"Asciidoctor 2.0.20"/>
8 <title>git-log(
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"/>
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"; */
14 html{font-family:sans-serif;-webkit-text-size-adjust:
100%}
16 a:focus{outline:thin dotted}
17 a:active,a:hover{outline:
0}
18 h1{font-size:
2em;margin:
.67em
0}
19 b,strong{font-weight:bold}
21 abbr[title]{cursor:help;border-bottom:
1px dotted #dddddf;text-decoration:none}
22 dfn{font-style:italic}
24 mark{background:#ff0;color:#
000}
25 code,kbd,pre,samp{font-family:monospace;font-size:
1em}
26 pre{white-space:pre-wrap}
27 q{quotes:
"\201C" "\201D" "\2018" "\2019"}
29 sub,sup{font-size:
75%;line-height:
0;position:relative;vertical-align:baseline}
33 svg:not(:root){overflow:hidden}
35 audio,video{display:inline-block}
36 audio:not([controls]){display:none;height:
0}
37 fieldset{border:
1px solid silver;margin:
0 2px;padding:
.35em
.625em
.75em}
38 legend{border:
0;padding:
0}
39 button,input,select,textarea{font-family:inherit;font-size:
100%;margin:
0}
40 button,input{line-height:normal}
41 button,select{text-transform:none}
42 button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43 button[disabled],html input[disabled]{cursor:default}
44 input[type=checkbox],input[type=radio]{padding:
0}
45 button::-moz-focus-inner,input::-moz-focus-inner{border:
0;padding:
0}
46 textarea{overflow:auto;vertical-align:top}
47 table{border-collapse:collapse;border-spacing:
0}
48 *,::before,::after{box-sizing:border-box}
49 html,body{font-size:
100%}
50 body{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}
51 a:hover{cursor:pointer}
52 img,object,embed{max-width:
100%;height:auto}
53 object,embed{height:
100%}
54 img{-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}
62 img,object,svg{display:inline-block;vertical-align:middle}
63 textarea{height:auto;min-height:
50px}
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}
66 div,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}
67 a{color:#
2156a5;text-decoration:underline;line-height:inherit}
68 a:hover,a:focus{color:#
1d4b8f}
70 p{line-height:
1.6;margin-bottom:
1.25em;text-rendering:optimizeLegibility}
71 p aside{font-size:
.875em;line-height:
1.35;font-style:italic}
72 h1,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}
73 h1 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}
75 h2{font-size:
1.6875em}
76 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.375em}
77 h4,h5{font-size:
1.125em}
79 hr{border:solid #dddddf;border-width:
1px
0 0;clear:both;margin:
1.25em
0 1.1875em}
80 em,i{font-style:italic;line-height:inherit}
81 strong,b{font-weight:bold;line-height:inherit}
82 small{font-size:
60%;line-height:inherit}
83 code{font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;font-weight:
400;color:rgba(
0,
0,
0,
.9)}
84 ul,ol,dl{line-height:
1.6;margin-bottom:
1.25em;list-style-position:outside;font-family:inherit}
85 ul,ol{margin-left:
1.5em}
86 ul li ul,ul li ol{margin-left:
1.25em;margin-bottom:
0}
87 ul.circle{list-style-type:circle}
88 ul.disc{list-style-type:disc}
89 ul.square{list-style-type:square}
90 ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91 ol li ul,ol li ol{margin-left:
1.25em;margin-bottom:
0}
92 dl dt{margin-bottom:
.3125em;font-weight:bold}
93 dl dd{margin-bottom:
1.25em}
94 blockquote{margin:
0 0 1.25em;padding:
.5625em
1.25em
0 1.1875em;border-left:
1px solid #ddd}
95 blockquote,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}
98 h2{font-size:
2.3125em}
99 h3,#toctitle,.sidebarblock
>.content
>.title{font-size:
1.6875em}
100 h4{font-size:
1.4375em}}
101 table{background:#fff;margin-bottom:
1.25em;border:
1px solid #dedede;word-wrap:normal}
102 table thead,table tfoot{background:#f7f8f7}
103 table 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}
104 table tr th,table tr td{padding:
.5625em
.625em;font-size:inherit;color:rgba(
0,
0,
0,
.8)}
105 table tr.even,table tr.alt{background:#f8f8f7}
106 table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:
1.6}
107 h1,h2,h3,#toctitle,.sidebarblock
>.content
>.title,h4,h5,h6{line-height:
1.2;word-spacing:-
.05em}
108 h1 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}
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}
117 pre{color:rgba(
0,
0,
0,
.9);font-family:
"Droid Sans Mono",
"DejaVu Sans Mono",monospace;line-height:
1.45;text-rendering:optimizeSpeed}
118 pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119 pre
>code{display:block}
120 pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121 em em{font-style:normal}
122 strong strong{font-weight:
400}
123 .keyseq{color:rgba(
51,
51,
51,
.8)}
124 kbd{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}
132 b.button::before,b.button::after{position:relative;top:-
1px;font-weight:
400}
133 b.button::before{content:
"[";padding:
0 3px
0 2px}
134 b.button::after{content:
"]";padding:
0 2px
0 3px}
135 p 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}
143 #header
>h1:only-child,body.toc2 #header
>h1:nth-last-child(
2){border-bottom:
1px solid #dddddf;padding-bottom:
8px}
144 #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}
164 body.toc2{padding-left:
15em;padding-right:
0}
165 #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}
166 #toc.toc2 #toctitle{margin-top:
0;margin-bottom:
.8rem;font-size:
1.2em}
167 #toc.toc2
>ul{font-size:
.9em;margin-bottom:
0}
168 #toc.toc2 ul ul{margin-left:
0;padding-left:
1em}
169 #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:
0;margin-top:
.5em;margin-bottom:
.5em}
170 body.toc2.toc-right{padding-left:
0;padding-right:
15em}
171 body.toc2.toc-right #toc.toc2{border-right-width:
0;border-left:
1px solid #e7e7e9;left:auto;right:
0}}
172 @media screen and (min-width:
1280px){body.toc2{padding-left:
20em;padding-right:
0}
173 #toc.toc2{width:
20em}
174 #toc.toc2 #toctitle{font-size:
1.375em}
175 #toc.toc2
>ul{font-size:
.95em}
176 #toc.toc2 ul ul{padding-left:
1.25em}
177 body.toc2.toc-right{padding-left:
0;padding-right:
20em}}
178 #content #toc{border:
1px solid #e0e0dc;margin-bottom:
1.25em;padding:
1.25em;background:#f8f8f7;border-radius:
4px}
179 #content #toc
>:first-child{margin-top:
0}
180 #content #toc
>:last-child{margin-bottom:
0}
181 #footer{max-width:none;background:rgba(
0,
0,
0,
.8);padding:
1.25em}
182 #footer-text{color:hsla(
0,
0%,
100%,
.8);line-height:
1.44}
183 #content{margin-bottom:
.625em}
184 .sect1{padding-bottom:
.625em}
185 @media screen and (min-width:
768px){#content{margin-bottom:
1.25em}
186 .sect1{padding-bottom:
1.25em}}
187 .sect1:last-child{padding-bottom:
0}
188 .sect1+.sect1{border-top:
1px solid #e7e7e9}
189 #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}
190 #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}
191 #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}
192 #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}
193 #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}
194 details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:
1.25em}
195 details{margin-left:
1.25rem}
196 details
>summary{cursor:pointer;display:block;position:relative;line-height:
1.6;margin-bottom:
.625rem;outline:none;-webkit-tap-highlight-color:transparent}
197 details
>summary::-webkit-details-marker{display:none}
198 details
>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%)}
199 details[open]
>summary::before{border:solid transparent;border-top:solid;border-width:
.5em
.3em
0;transform:translateY(
15%)}
200 details
>summary::after{content:
"";width:
1.25rem;height:
1em;position:absolute;top:
.3em;left:-
1.25rem}
201 .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}
202 table.tableblock.fit-content
>caption.title{white-space:nowrap;width:
0}
203 .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)}
204 .admonitionblock
>table{border-collapse:separate;border:
0;background:none;width:
100%}
205 .admonitionblock
>table td.icon{text-align:center;width:
80px}
206 .admonitionblock
>table td.icon img{max-width:none}
207 .admonitionblock
>table td.icon .title{font-weight:bold;font-family:
"Open Sans",
"DejaVu Sans",sans-serif;text-transform:uppercase}
208 .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}
209 .admonitionblock
>table td.content
>:last-child
>:last-child{margin-bottom:
0}
210 .exampleblock
>.content{border:
1px solid #e6e6e6;margin-bottom:
1.25em;padding:
1.25em;background:#fff;border-radius:
4px}
211 .sidebarblock{border:
1px solid #dbdbd6;margin-bottom:
1.25em;padding:
1.25em;background:#f3f3f2;border-radius:
4px}
212 .sidebarblock
>.content
>.title{color:#
7a2518;margin-top:
0;text-align:center}
213 .exampleblock
>.content
>:first-child,.sidebarblock
>.content
>:first-child{margin-top:
0}
214 .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}
215 .literalblock pre,.listingblock
>.content
>pre{border-radius:
4px;overflow-x:auto;padding:
1em;font-size:
.8125em}
216 @media screen and (min-width:
768px){.literalblock pre,.listingblock
>.content
>pre{font-size:
.90625em}}
217 @media screen and (min-width:
1280px){.literalblock pre,.listingblock
>.content
>pre{font-size:
1em}}
218 .literalblock pre,.listingblock
>.content
>pre:not(.highlight),.listingblock
>.content
>pre[class=highlight],.listingblock
>.content
>pre[class^=
"highlight "]{background:#f7f7f8}
219 .literalblock.output pre{color:#f7f7f8;background:rgba(
0,
0,
0,
.9)}
220 .listingblock
>.content{position:relative}
221 .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}
222 .listingblock:hover code[data-lang]::before{display:block}
223 .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:
.5em;color:inherit;opacity:
.5}
224 .listingblock.terminal pre .command:not([data-prompt])::before{content:
"$"}
225 .listingblock pre.highlightjs{padding:
0}
226 .listingblock pre.highlightjs
>code{padding:
1em;border-radius:
4px}
227 .listingblock pre.prettyprint{border-width:
0}
228 .prettyprint{background:#f7f7f8}
229 pre.prettyprint .linenums{line-height:
1.45;margin-left:
2em}
230 pre.prettyprint li{background:none;list-style-type:inherit;padding-left:
0}
231 pre.prettyprint li code[data-lang]::before{opacity:
1}
232 pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
233 table.linenotable{border-collapse:separate;border:
0;margin-bottom:
0;background:none}
234 table.linenotable td[class]{color:inherit;vertical-align:top;padding:
0;line-height:inherit;white-space:normal}
235 table.linenotable td.code{padding-left:
.75em}
236 table.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}
237 pre.pygments span.linenos{display:inline-block;margin-right:
.75em}
238 .quoteblock{margin:
0 1em
1.25em
1.5em;display:table}
239 .quoteblock:not(.excerpt)
>.title{margin-left:-
1.5em;margin-bottom:
.75em}
240 .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}
241 .quoteblock blockquote{margin:
0;padding:
0;border:
0}
242 .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)}
243 .quoteblock blockquote
>.paragraph:last-child p{margin-bottom:
0}
244 .quoteblock .attribution{margin-top:
.75em;margin-right:
.5ex;text-align:right}
245 .verseblock{margin:
0 1em
1.25em}
246 .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}
247 .verseblock pre strong{font-weight:
400}
248 .verseblock .attribution{margin-top:
1.25rem;margin-left:
.5ex}
249 .quoteblock .attribution,.verseblock .attribution{font-size:
.9375em;line-height:
1.45;font-style:italic}
250 .quoteblock .attribution br,.verseblock .attribution br{display:none}
251 .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-
.025em;color:rgba(
0,
0,
0,
.6)}
252 .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
253 .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}
254 .quoteblock.abstract{margin:
0 1em
1.25em;display:block}
255 .quoteblock.abstract
>.title{margin:
0 0 .375em;font-size:
1.15em;text-align:center}
256 .quoteblock.excerpt
>blockquote,.quoteblock .quoteblock{padding:
0 0 .25em
1em;border-left:
.25em solid #dddddf}
257 .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:
0}
258 .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:
1.0625rem}
259 .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:
.85rem;text-align:left;margin-right:
0}
260 p.tableblock:last-child{margin-bottom:
0}
261 td.tableblock
>.content{margin-bottom:
1.25em;word-wrap:anywhere}
262 td.tableblock
>.content
>:last-child{margin-bottom:-
1.25em}
263 table.tableblock,th.tableblock,td.tableblock{border:
0 solid #dedede}
264 table.grid-all
>*
>tr
>*{border-width:
1px}
265 table.grid-cols
>*
>tr
>*{border-width:
0 1px}
266 table.grid-rows
>*
>tr
>*{border-width:
1px
0}
267 table.frame-all{border-width:
1px}
268 table.frame-ends{border-width:
1px
0}
269 table.frame-sides{border-width:
0 1px}
270 table.frame-none
>colgroup+*
>:first-child
>*,table.frame-sides
>colgroup+*
>:first-child
>*{border-top-width:
0}
271 table.frame-none
>:last-child
>:last-child
>*,table.frame-sides
>:last-child
>:last-child
>*{border-bottom-width:
0}
272 table.frame-none
>*
>tr
>:first-child,table.frame-ends
>*
>tr
>:first-child{border-left-width:
0}
273 table.frame-none
>*
>tr
>:last-child,table.frame-ends
>*
>tr
>:last-child{border-right-width:
0}
274 table.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}
275 th.halign-left,td.halign-left{text-align:left}
276 th.halign-right,td.halign-right{text-align:right}
277 th.halign-center,td.halign-center{text-align:center}
278 th.valign-top,td.valign-top{vertical-align:top}
279 th.valign-bottom,td.valign-bottom{vertical-align:bottom}
280 th.valign-middle,td.valign-middle{vertical-align:middle}
281 table thead th,table tfoot th{font-weight:bold}
282 tbody tr th{background:#f7f8f7}
283 tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(
0,
0,
0,
.8);font-weight:bold}
284 p.tableblock
>code:only-child{background:none;padding:
0}
285 p.tableblock{font-size:
1em}
286 ol{margin-left:
1.75em}
287 ul li ol{margin-left:
1.5em}
288 dl dd{margin-left:
1.125em}
289 dl dd:last-child,dl dd:last-child
>:last-child{margin-bottom:
0}
290 li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:
.625em}
291 ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292 ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:
.625em}
293 ul.unstyled,ol.unstyled{margin-left:
0}
294 li
>p:empty:only-child::before{content:
"";display:inline-block}
295 ul.checklist
>li
>p:first-child{margin-left:-
1em}
296 ul.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}
297 ul.checklist
>li
>p:first-child
>input[type=checkbox]:first-child{margin-right:
.25em}
298 ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:
0 0 .625em -
1.25em}
299 ul.inline
>li{margin-left:
1.25em}
300 .unstyled dl dt{font-weight:
400;font-style:normal}
301 ol.arabic{list-style-type:decimal}
302 ol.decimal{list-style-type:decimal-leading-zero}
303 ol.loweralpha{list-style-type:lower-alpha}
304 ol.upperalpha{list-style-type:upper-alpha}
305 ol.lowerroman{list-style-type:lower-roman}
306 ol.upperroman{list-style-type:upper-roman}
307 ol.lowergreek{list-style-type:lower-greek}
308 .hdlist
>table,.colist
>table{border:
0;background:none}
309 .hdlist
>table
>tbody
>tr,.colist
>table
>tbody
>tr{background:none}
310 td.hdlist1,td.hdlist2{vertical-align:top;padding:
0 .625em}
311 td.hdlist1{font-weight:bold;padding-bottom:
1.25em}
312 td.hdlist2{word-wrap:anywhere}
313 .literalblock+.colist,.listingblock+.colist{margin-top:-
.5em}
314 .colist td:not([class]):first-child{padding:
.4em
.75em
0;line-height:
1;vertical-align:top}
315 .colist td:not([class]):first-child img{max-width:none}
316 .colist td:not([class]):last-child{padding:
.25em
0}
317 .thumb,.th{line-height:
0;display:inline-block;border:
4px solid #fff;box-shadow:
0 0 0 1px #ddd}
318 .imageblock.left{margin:
.25em
.625em
1.25em
0}
319 .imageblock.right{margin:
.25em
0 1.25em
.625em}
320 .imageblock
>.title{margin-bottom:
0}
321 .imageblock.thumb,.imageblock.th{border-width:
6px}
322 .imageblock.thumb
>.title,.imageblock.th
>.title{padding:
0 .125em}
323 .image.left,.image.right{margin-top:
.25em;margin-bottom:
.25em;display:inline-block;line-height:
0}
324 .image.left{margin-right:
.625em}
325 .image.right{margin-left:
.625em}
326 a.image{text-decoration:none;display:inline-block}
327 a.image object{pointer-events:none}
328 sup.footnote,sup.footnoteref{font-size:
.875em;position:static;vertical-align:super}
329 sup.footnote a,sup.footnoteref a{text-decoration:none}
330 sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
331 #footnotes{padding-top:
.75em;padding-bottom:
.75em;margin-bottom:
.625em}
332 #footnotes hr{width:
20%;min-width:
6.25em;margin:-
.25em
0 .75em;border-width:
1px
0 0}
333 #footnotes .footnote{padding:
0 .375em
0 .225em;line-height:
1.3334;font-size:
.875em;margin-left:
1.2em;margin-bottom:
.2em}
334 #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-
1.05em}
335 #footnotes .footnote:last-of-type{margin-bottom:
0}
336 #content #footnotes{margin-top:-
.625em;margin-bottom:
0;padding:
.75em
0}
337 div.unbreakable{page-break-inside:avoid}
338 .big{font-size:larger}
339 .small{font-size:smaller}
340 .underline{text-decoration:underline}
341 .overline{text-decoration:overline}
342 .line-through{text-decoration:line-through}
344 .aqua-background{background:#
00fafa}
346 .black-background{background:#
000}
348 .blue-background{background:#
0000fa}
349 .fuchsia{color:#bf00bf}
350 .fuchsia-background{background:#fa00fa}
352 .gray-background{background:#
7d7d7d}
353 .green{color:#
006000}
354 .green-background{background:#
007d00}
356 .lime-background{background:#
00fa00}
357 .maroon{color:#
600000}
358 .maroon-background{background:#
7d0000}
360 .navy-background{background:#
00007d}
361 .olive{color:#
606000}
362 .olive-background{background:#
7d7d00}
363 .purple{color:#
600060}
364 .purple-background{background:#
7d007d}
366 .red-background{background:#fa0000}
367 .silver{color:#
909090}
368 .silver-background{background:#bcbcbc}
370 .teal-background{background:#
007d7d}
371 .white{color:#bfbfbf}
372 .white-background{background:#fafafa}
373 .yellow{color:#bfbf00}
374 .yellow-background{background:#fafa00}
375 span.icon
>.fa{cursor:default}
376 a span.icon
>.fa{cursor:inherit}
377 .admonitionblock td.icon [class^=
"fa icon-"]{font-size:
2.5em;text-shadow:
1px
1px
2px rgba(
0,
0,
0,
.5);cursor:default}
378 .admonitionblock td.icon .icon-note::before{content:
"\f05a";color:#
19407c}
379 .admonitionblock td.icon .icon-tip::before{content:
"\f0eb";text-shadow:
1px
1px
2px rgba(
155,
155,
0,
.8);color:#
111}
380 .admonitionblock td.icon .icon-warning::before{content:
"\f071";color:#bf6900}
381 .admonitionblock td.icon .icon-caution::before{content:
"\f06d";color:#bf3400}
382 .admonitionblock td.icon .icon-important::before{content:
"\f06a";color:#bf0000}
383 .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}
384 .conum[data-value] *{color:#fff!important}
385 .conum[data-value]+b{display:none}
386 .conum[data-value]::after{content:attr(data-value)}
387 pre .conum[data-value]{position:relative;top:-
.125em}
388 b.conum *{color:inherit!important}
389 .conum:not([data-value]):empty{display:none}
390 dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391 h1,h2,p,td.content,span.alt,summary{letter-spacing:-
.01em}
392 p strong,td.content strong,div.footnote strong{letter-spacing:-
.005em}
393 p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:
1.0625rem}
394 p{margin-bottom:
1.25rem}
395 .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:
1em}
396 .exampleblock
>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:
0 1px
4px #e0e0dc}
397 .print-only{display:none!important}
398 @page{margin:
1.25cm
.75cm}
399 @media print{*{box-shadow:none!important;text-shadow:none!important}
401 a{color:inherit!important;text-decoration:underline!important}
402 a.bare,a[href^=
"#"],a[href^=
"mailto:"]{text-decoration:none!important}
403 a[href^=
"http:"]:not(.bare)::after,a[href^=
"https:"]:not(.bare)::after{content:
"(" attr(href)
")";display:inline-block;font-size:
.875em;padding-left:
.25em}
404 abbr[title]{border-bottom:
1px dotted}
405 abbr[title]::after{content:
" (" attr(title)
")"}
406 pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
407 thead{display:table-header-group}
409 p,blockquote,dt,td.content{font-size:
1em;orphans:
3;widows:
3}
410 h2,h3,#toctitle,.sidebarblock
>.content
>.title{page-break-after:avoid}
411 #header,#content,#footnotes,#footer{max-width:none}
412 #toc,.sidebarblock,.exampleblock
>.content{background:none!important}
413 #toc{border-bottom:
1px solid #dddddf!important;padding-bottom:
0!important}
414 body.book #header{text-align:center}
415 body.book #header
>h1:first-child{border:
0!important;margin:
2.5em
0 1em}
416 body.book #header .details{border:
0!important;display:block;padding:
0!important}
417 body.book #header .details span:first-child{margin-left:
0!important}
418 body.book #header .details br{display:block}
419 body.book #header .details br+span::before{content:none!important}
420 body.book #toc{border:
0!important;text-align:left!important;padding:
0!important;margin:
0!important}
421 body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1
>h2{page-break-before:always}
422 .listingblock code[data-lang]::before{display:block}
423 #footer{padding:
0 .9375em}
424 .hide-on-print{display:none!important}
425 .print-only{display:block!important}
426 .hide-for-print{display:none!important}
427 .show-for-print{display:inherit!important}}
428 @media amzn-kf8,print{#header
>h1:first-child{margin-top:
1.25rem}
429 .sect1{padding:
0!important}
430 .sect1+.sect1{border:
0}
431 #footer{background:none}
432 #footer-text{color:rgba(
0,
0,
0,
.6);font-size:
.9em}}
433 @media amzn-kf8{#header,#content,#footnotes,#footer{padding:
0}}
441 <body class=
"manpage">
443 <h1>git-log(
1) Manual Page
</h1>
444 <h2 id=
"_name">NAME
</h2>
445 <div class=
"sectionbody">
446 <p>git-log - Show commit logs
</p>
451 <h2 id=
"_synopsis">SYNOPSIS
</h2>
452 <div class=
"sectionbody">
453 <div class=
"verseblock">
454 <pre class=
"content"><em>git log
</em> [
<options
>] [
<revision-range
>] [[--]
<path
>…​]
</pre>
459 <h2 id=
"_description">DESCRIPTION
</h2>
460 <div class=
"sectionbody">
461 <div class=
"paragraph">
462 <p>Shows the commit logs.
</p>
464 <div class=
"paragraph">
465 <p>List commits that are reachable by following the
<code>parent
</code> links from the
466 given commit(s), but exclude commits that are reachable from the one(s)
467 given with a
<em>^
</em> in front of them. The output is given in reverse
468 chronological order by default.
</p>
470 <div class=
"paragraph">
471 <p>You can think of this as a set operation. Commits reachable from any of
472 the commits given on the command line form a set, and then commits reachable
473 from any of the ones given with
<em>^
</em> in front are subtracted from that
474 set. The remaining commits are what comes out in the command
’s output.
475 Various other options and paths parameters can be used to further limit the
478 <div class=
"paragraph">
479 <p>Thus, the following command:
</p>
481 <div class=
"listingblock">
482 <div class=
"content">
483 <pre>$ git log foo bar ^baz
</pre>
486 <div class=
"paragraph">
487 <p>means
"list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but
488 not from <em>baz</em>".
</p>
490 <div class=
"paragraph">
491 <p>A special notation
"<em><commit1></em>..<em><commit2></em>" can be used as a
492 short-hand for
"^<em><commit1></em> <em><commit2></em>". For example, either of
493 the following may be used interchangeably:
</p>
495 <div class=
"listingblock">
496 <div class=
"content">
497 <pre>$ git log origin..HEAD
498 $ git log HEAD ^origin
</pre>
501 <div class=
"paragraph">
502 <p>Another special notation is
"<em><commit1></em>…​<em><commit2></em>" which is useful
503 for merges. The resulting set of commits is the symmetric difference
504 between the two operands. The following two commands are equivalent:
</p>
506 <div class=
"listingblock">
507 <div class=
"content">
508 <pre>$ git log A B --not $(git merge-base --all A B)
509 $ git log A...B
</pre>
512 <div class=
"paragraph">
513 <p>The command takes options applicable to the
<a href=
"git-rev-list.html">git-rev-list(
1)
</a>
514 command to control what is shown and how, and options applicable to
515 the
<a href=
"git-diff.html">git-diff(
1)
</a> command to control how the changes
516 each commit introduces are shown.
</p>
521 <h2 id=
"_options">OPTIONS
</h2>
522 <div class=
"sectionbody">
525 <dt class=
"hdlist1">--follow
</dt>
527 <p>Continue listing the history of a file beyond renames
528 (works only for a single file).
</p>
530 <dt class=
"hdlist1">--no-decorate
</dt>
531 <dt class=
"hdlist1">--decorate[=short|full|auto|no]
</dt>
533 <p>Print out the ref names of any commits that are shown. If
<em>short
</em> is
534 specified, the ref name prefixes
<em>refs/heads/
</em>,
<em>refs/tags/
</em> and
535 <em>refs/remotes/
</em> will not be printed. If
<em>full
</em> is specified, the
536 full ref name (including prefix) will be printed. If
<em>auto
</em> is
537 specified, then if the output is going to a terminal, the ref names
538 are shown as if
<em>short
</em> were given, otherwise no ref names are
539 shown. The option
<code>--decorate
</code> is short-hand for
<code>--decorate=short
</code>.
540 Default to configuration value of
<code>log.decorate
</code> if configured,
541 otherwise,
<code>auto
</code>.
</p>
543 <dt class=
"hdlist1">--decorate-refs=
<pattern
></dt>
544 <dt class=
"hdlist1">--decorate-refs-exclude=
<pattern
></dt>
546 <p>For each candidate reference, do not use it for decoration if it
547 matches any patterns given to
<code>--decorate-refs-exclude
</code> or if it
548 doesn
’t match any of the patterns given to
<code>--decorate-refs
</code>. The
549 <code>log.excludeDecoration
</code> config option allows excluding refs from
550 the decorations, but an explicit
<code>--decorate-refs
</code> pattern will
551 override a match in
<code>log.excludeDecoration
</code>.
</p>
552 <div class=
"paragraph">
553 <p>If none of these options or config settings are given, then references are
554 used as decoration if they match
<code>HEAD
</code>,
<code>refs/heads/
</code>,
<code>refs/remotes/
</code>,
555 <code>refs/stash/
</code>, or
<code>refs/tags/
</code>.
</p>
558 <dt class=
"hdlist1">--clear-decorations
</dt>
560 <p>When specified, this option clears all previous
<code>--decorate-refs
</code>
561 or
<code>--decorate-refs-exclude
</code> options and relaxes the default
562 decoration filter to include all references. This option is
563 assumed if the config value
<code>log.initialDecorationSet
</code> is set to
564 <code>all
</code>.
</p>
566 <dt class=
"hdlist1">--source
</dt>
568 <p>Print out the ref name given on the command line by which each
569 commit was reached.
</p>
571 <dt class=
"hdlist1">--[no-]mailmap
</dt>
572 <dt class=
"hdlist1">--[no-]use-mailmap
</dt>
574 <p>Use mailmap file to map author and committer names and email
575 addresses to canonical real names and email addresses. See
576 <a href=
"git-shortlog.html">git-shortlog(
1)
</a>.
</p>
578 <dt class=
"hdlist1">--full-diff
</dt>
580 <p>Without this flag,
<code>git log -p
<path
>...
</code> shows commits that
581 touch the specified paths, and diffs about the same specified
582 paths. With this, the full diff is shown for commits that touch
583 the specified paths; this means that
"<path>…​" limits only
584 commits, and doesn
’t limit diff for those commits.
</p>
585 <div class=
"paragraph">
586 <p>Note that this affects all diff-based output types, e.g. those
587 produced by
<code>--stat
</code>, etc.
</p>
590 <dt class=
"hdlist1">--log-size
</dt>
592 <p>Include a line
“log size
<number
>” in the output for each commit,
593 where
<number
> is the length of that commit
’s message in bytes.
594 Intended to speed up tools that read log messages from
<code>git log
</code>
595 output by allowing them to allocate space in advance.
</p>
597 <dt class=
"hdlist1">-L
<start
>,
<end
>:
<file
></dt>
598 <dt class=
"hdlist1">-L:
<funcname
>:
<file
></dt>
600 <p>Trace the evolution of the line range given by
<em><start
>,
<end
></em>,
601 or by the function name regex
<em><funcname
></em>, within the
<em><file
></em>. You may
602 not give any pathspec limiters. This is currently limited to
603 a walk starting from a single revision, i.e., you may only
604 give zero or one positive revision arguments, and
605 <em><start
></em> and
<em><end
></em> (or
<em><funcname
></em>) must exist in the starting revision.
606 You can specify this option more than once. Implies
<code>--patch
</code>.
607 Patch output can be suppressed using
<code>--no-patch
</code>, but other diff formats
608 (namely
<code>--raw
</code>,
<code>--numstat
</code>,
<code>--shortstat
</code>,
<code>--dirstat
</code>,
<code>--summary
</code>,
609 <code>--name-only
</code>,
<code>--name-status
</code>,
<code>--check
</code>) are not currently implemented.
</p>
610 <div class=
"paragraph">
611 <p><em><start
></em> and
<em><end
></em> can take one of these forms:
</p>
617 <div class=
"paragraph">
618 <p>If
<em><start
></em> or
<em><end
></em> is a number, it specifies an
619 absolute line number (lines count from
1).
</p>
623 <p><code>/regex/
</code></p>
624 <div class=
"paragraph">
625 <p>This form will use the first line matching the given
626 POSIX regex. If
<em><start
></em> is a regex, it will search from the end of
627 the previous
<code>-L
</code> range, if any, otherwise from the start of file.
628 If
<em><start
></em> is
<code>^/regex/
</code>, it will search from the start of file.
629 If
<em><end
></em> is a regex, it will search
630 starting at the line given by
<em><start
></em>.
</p>
634 <p>+offset or -offset
</p>
635 <div class=
"paragraph">
636 <p>This is only valid for
<em><end
></em> and will specify a number
637 of lines before or after the line given by
<em><start
></em>.
</p>
642 <div class=
"paragraph">
643 <p>If
<code>:
<funcname
></code> is given in place of
<em><start
></em> and
<em><end
></em>, it is a
644 regular expression that denotes the range from the first funcname line
645 that matches
<em><funcname
></em>, up to the next funcname line.
<code>:
<funcname
></code>
646 searches from the end of the previous
<code>-L
</code> range, if any, otherwise
647 from the start of file.
<code>^:
<funcname
></code> searches from the start of
648 file. The function names are determined in the same way as
<code>git diff
</code>
649 works out patch hunk headers (see
<em>Defining a custom hunk-header
</em>
650 in
<a href=
"gitattributes.html">gitattributes(
5)
</a>).
</p>
653 <dt class=
"hdlist1"><revision-range
></dt>
655 <p>Show only commits in the specified revision range. When no
656 <revision-range
> is specified, it defaults to
<code>HEAD
</code> (i.e. the
657 whole history leading to the current commit).
<code>origin..HEAD
</code>
658 specifies all the commits reachable from the current commit
659 (i.e.
<code>HEAD
</code>), but not from
<code>origin
</code>. For a complete list of
660 ways to spell
<revision-range
>, see the
<em>Specifying Ranges
</em>
661 section of
<a href=
"gitrevisions.html">gitrevisions(
7)
</a>.
</p>
663 <dt class=
"hdlist1">[--]
<path
>…​</dt>
665 <p>Show only commits that are enough to explain how the files
666 that match the specified paths came to be. See
<em>History
667 Simplification
</em> below for details and other simplification
669 <div class=
"paragraph">
670 <p>Paths may need to be prefixed with
<code>--
</code> to separate them from
671 options or the revision range, when confusion arises.
</p>
677 <h3 id=
"_commit_limiting">Commit Limiting
</h3>
678 <div class=
"paragraph">
679 <p>Besides specifying a range of commits that should be listed using the
680 special notations explained in the description, additional commit
681 limiting may be applied.
</p>
683 <div class=
"paragraph">
684 <p>Using more options generally further limits the output (e.g.
685 <code>--since=
<date1
></code> limits to commits newer than
<code><date1
></code>, and using it
686 with
<code>--grep=
<pattern
></code> further limits to commits whose log message
687 has a line that matches
<code><pattern
></code>), unless otherwise noted.
</p>
689 <div class=
"paragraph">
690 <p>Note that these are applied before commit
691 ordering and formatting options, such as
<code>--reverse
</code>.
</p>
695 <dt class=
"hdlist1">-
<number
></dt>
696 <dt class=
"hdlist1">-n
<number
></dt>
697 <dt class=
"hdlist1">--max-count=
<number
></dt>
699 <p>Limit the number of commits to output.
</p>
701 <dt class=
"hdlist1">--skip=
<number
></dt>
703 <p>Skip
<em>number
</em> commits before starting to show the commit output.
</p>
705 <dt class=
"hdlist1">--since=
<date
></dt>
706 <dt class=
"hdlist1">--after=
<date
></dt>
708 <p>Show commits more recent than a specific date.
</p>
710 <dt class=
"hdlist1">--since-as-filter=
<date
></dt>
712 <p>Show all commits more recent than a specific date. This visits
713 all commits in the range, rather than stopping at the first commit which
714 is older than a specific date.
</p>
716 <dt class=
"hdlist1">--until=
<date
></dt>
717 <dt class=
"hdlist1">--before=
<date
></dt>
719 <p>Show commits older than a specific date.
</p>
721 <dt class=
"hdlist1">--author=
<pattern
></dt>
722 <dt class=
"hdlist1">--committer=
<pattern
></dt>
724 <p>Limit the commits output to ones with author/committer
725 header lines that match the specified pattern (regular
726 expression). With more than one
<code>--author=
<pattern
></code>,
727 commits whose author matches any of the given patterns are
728 chosen (similarly for multiple
<code>--committer=
<pattern
></code>).
</p>
730 <dt class=
"hdlist1">--grep-reflog=
<pattern
></dt>
732 <p>Limit the commits output to ones with reflog entries that
733 match the specified pattern (regular expression). With
734 more than one
<code>--grep-reflog
</code>, commits whose reflog message
735 matches any of the given patterns are chosen. It is an
736 error to use this option unless
<code>--walk-reflogs
</code> is in use.
</p>
738 <dt class=
"hdlist1">--grep=
<pattern
></dt>
740 <p>Limit the commits output to ones with a log message that
741 matches the specified pattern (regular expression). With
742 more than one
<code>--grep=
<pattern
></code>, commits whose message
743 matches any of the given patterns are chosen (but see
744 <code>--all-match
</code>).
</p>
745 <div class=
"paragraph">
746 <p>When
<code>--notes
</code> is in effect, the message from the notes is
747 matched as if it were part of the log message.
</p>
750 <dt class=
"hdlist1">--all-match
</dt>
752 <p>Limit the commits output to ones that match all given
<code>--grep
</code>,
753 instead of ones that match at least one.
</p>
755 <dt class=
"hdlist1">--invert-grep
</dt>
757 <p>Limit the commits output to ones with a log message that do not
758 match the pattern specified with
<code>--grep=
<pattern
></code>.
</p>
760 <dt class=
"hdlist1">-i
</dt>
761 <dt class=
"hdlist1">--regexp-ignore-case
</dt>
763 <p>Match the regular expression limiting patterns without regard to letter
766 <dt class=
"hdlist1">--basic-regexp
</dt>
768 <p>Consider the limiting patterns to be basic regular expressions;
769 this is the default.
</p>
771 <dt class=
"hdlist1">-E
</dt>
772 <dt class=
"hdlist1">--extended-regexp
</dt>
774 <p>Consider the limiting patterns to be extended regular expressions
775 instead of the default basic regular expressions.
</p>
777 <dt class=
"hdlist1">-F
</dt>
778 <dt class=
"hdlist1">--fixed-strings
</dt>
780 <p>Consider the limiting patterns to be fixed strings (don
’t interpret
781 pattern as a regular expression).
</p>
783 <dt class=
"hdlist1">-P
</dt>
784 <dt class=
"hdlist1">--perl-regexp
</dt>
786 <p>Consider the limiting patterns to be Perl-compatible regular
788 <div class=
"paragraph">
789 <p>Support for these types of regular expressions is an optional
790 compile-time dependency. If Git wasn
’t compiled with support for them
791 providing this option will cause it to die.
</p>
794 <dt class=
"hdlist1">--remove-empty
</dt>
796 <p>Stop when a given path disappears from the tree.
</p>
798 <dt class=
"hdlist1">--merges
</dt>
800 <p>Print only merge commits. This is exactly the same as
<code>--min-parents=
2</code>.
</p>
802 <dt class=
"hdlist1">--no-merges
</dt>
804 <p>Do not print commits with more than one parent. This is
805 exactly the same as
<code>--max-parents=
1</code>.
</p>
807 <dt class=
"hdlist1">--min-parents=
<number
></dt>
808 <dt class=
"hdlist1">--max-parents=
<number
></dt>
809 <dt class=
"hdlist1">--no-min-parents
</dt>
810 <dt class=
"hdlist1">--no-max-parents
</dt>
812 <p>Show only commits which have at least (or at most) that many parent
813 commits. In particular,
<code>--max-parents=
1</code> is the same as
<code>--no-merges
</code>,
814 <code>--min-parents=
2</code> is the same as
<code>--merges
</code>.
<code>--max-parents=
0</code>
815 gives all root commits and
<code>--min-parents=
3</code> all octopus merges.
</p>
816 <div class=
"paragraph">
817 <p><code>--no-min-parents
</code> and
<code>--no-max-parents
</code> reset these limits (to no limit)
818 again. Equivalent forms are
<code>--min-parents=
0</code> (any commit has
0 or more
819 parents) and
<code>--max-parents=-
1</code> (negative numbers denote no upper limit).
</p>
822 <dt class=
"hdlist1">--first-parent
</dt>
824 <p>When finding commits to include, follow only the first
825 parent commit upon seeing a merge commit. This option
826 can give a better overview when viewing the evolution of
827 a particular topic branch, because merges into a topic
828 branch tend to be only about adjusting to updated upstream
829 from time to time, and this option allows you to ignore
830 the individual commits brought in to your history by such
832 <div class=
"paragraph">
833 <p>This option also changes default diff format for merge commits
834 to
<code>first-parent
</code>, see
<code>--diff-merges=first-parent
</code> for details.
</p>
837 <dt class=
"hdlist1">--exclude-first-parent-only
</dt>
839 <p>When finding commits to exclude (with a
<em>^
</em>), follow only
840 the first parent commit upon seeing a merge commit.
841 This can be used to find the set of changes in a topic branch
842 from the point where it diverged from the remote branch, given
843 that arbitrary merges can be valid topic branch changes.
</p>
845 <dt class=
"hdlist1">--not
</dt>
847 <p>Reverses the meaning of the
<em>^
</em> prefix (or lack thereof)
848 for all following revision specifiers, up to the next
<code>--not
</code>.
849 When used on the command line before --stdin, the revisions passed
850 through stdin will not be affected by it. Conversely, when passed
851 via standard input, the revisions passed on the command line will
852 not be affected by it.
</p>
854 <dt class=
"hdlist1">--all
</dt>
856 <p>Pretend as if all the refs in
<code>refs/
</code>, along with
<code>HEAD
</code>, are
857 listed on the command line as
<em><commit
></em>.
</p>
859 <dt class=
"hdlist1">--branches[=
<pattern
>]
</dt>
861 <p>Pretend as if all the refs in
<code>refs/heads
</code> are listed
862 on the command line as
<em><commit
></em>. If
<em><pattern
></em> is given, limit
863 branches to ones matching given shell glob. If pattern lacks
<em>?
</em>,
864 <em>*
</em>, or
<em>[
</em>,
<em>/*
</em> at the end is implied.
</p>
866 <dt class=
"hdlist1">--tags[=
<pattern
>]
</dt>
868 <p>Pretend as if all the refs in
<code>refs/tags
</code> are listed
869 on the command line as
<em><commit
></em>. If
<em><pattern
></em> is given, limit
870 tags to ones matching given shell glob. If pattern lacks
<em>?
</em>,
<em>*
</em>,
871 or
<em>[
</em>,
<em>/*
</em> at the end is implied.
</p>
873 <dt class=
"hdlist1">--remotes[=
<pattern
>]
</dt>
875 <p>Pretend as if all the refs in
<code>refs/remotes
</code> are listed
876 on the command line as
<em><commit
></em>. If
<em><pattern
></em> is given, limit
877 remote-tracking branches to ones matching given shell glob.
878 If pattern lacks
<em>?
</em>,
<em>*
</em>, or
<em>[
</em>,
<em>/*
</em> at the end is implied.
</p>
880 <dt class=
"hdlist1">--glob=
<glob-pattern
></dt>
882 <p>Pretend as if all the refs matching shell glob
<em><glob-pattern
></em>
883 are listed on the command line as
<em><commit
></em>. Leading
<em>refs/
</em>,
884 is automatically prepended if missing. If pattern lacks
<em>?
</em>,
<em>*
</em>,
885 or
<em>[
</em>,
<em>/*
</em> at the end is implied.
</p>
887 <dt class=
"hdlist1">--exclude=
<glob-pattern
></dt>
889 <p>Do not include refs matching
<em><glob-pattern
></em> that the next
<code>--all
</code>,
890 <code>--branches
</code>,
<code>--tags
</code>,
<code>--remotes
</code>, or
<code>--glob
</code> would otherwise
891 consider. Repetitions of this option accumulate exclusion patterns
892 up to the next
<code>--all
</code>,
<code>--branches
</code>,
<code>--tags
</code>,
<code>--remotes
</code>, or
893 <code>--glob
</code> option (other options or arguments do not clear
894 accumulated patterns).
</p>
895 <div class=
"paragraph">
896 <p>The patterns given should not begin with
<code>refs/heads
</code>,
<code>refs/tags
</code>, or
897 <code>refs/remotes
</code> when applied to
<code>--branches
</code>,
<code>--tags
</code>, or
<code>--remotes
</code>,
898 respectively, and they must begin with
<code>refs/
</code> when applied to
<code>--glob
</code>
899 or
<code>--all
</code>. If a trailing
<em>/*
</em> is intended, it must be given
903 <dt class=
"hdlist1">--exclude-hidden=[fetch|receive|uploadpack]
</dt>
905 <p>Do not include refs that would be hidden by
<code>git-fetch
</code>,
906 <code>git-receive-pack
</code> or
<code>git-upload-pack
</code> by consulting the appropriate
907 <code>fetch.hideRefs
</code>,
<code>receive.hideRefs
</code> or
<code>uploadpack.hideRefs
</code>
908 configuration along with
<code>transfer.hideRefs
</code> (see
909 <a href=
"git-config.html">git-config(
1)
</a>). This option affects the next pseudo-ref option
910 <code>--all
</code> or
<code>--glob
</code> and is cleared after processing them.
</p>
912 <dt class=
"hdlist1">--reflog
</dt>
914 <p>Pretend as if all objects mentioned by reflogs are listed on the
915 command line as
<code><commit
></code>.
</p>
917 <dt class=
"hdlist1">--alternate-refs
</dt>
919 <p>Pretend as if all objects mentioned as ref tips of alternate
920 repositories were listed on the command line. An alternate
921 repository is any repository whose object directory is specified
922 in
<code>objects/info/alternates
</code>. The set of included objects may
923 be modified by
<code>core.alternateRefsCommand
</code>, etc. See
924 <a href=
"git-config.html">git-config(
1)
</a>.
</p>
926 <dt class=
"hdlist1">--single-worktree
</dt>
928 <p>By default, all working trees will be examined by the
929 following options when there are more than one (see
930 <a href=
"git-worktree.html">git-worktree(
1)
</a>):
<code>--all
</code>,
<code>--reflog
</code> and
931 <code>--indexed-objects
</code>.
932 This option forces them to examine the current working tree
935 <dt class=
"hdlist1">--ignore-missing
</dt>
937 <p>Upon seeing an invalid object name in the input, pretend as if
938 the bad input was not given.
</p>
940 <dt class=
"hdlist1">--bisect
</dt>
942 <p>Pretend as if the bad bisection ref
<code>refs/bisect/bad
</code>
943 was listed and as if it was followed by
<code>--not
</code> and the good
944 bisection refs
<code>refs/bisect/good-*
</code> on the command
947 <dt class=
"hdlist1">--stdin
</dt>
949 <p>In addition to getting arguments from the command line, read
950 them from standard input as well. This accepts commits and
951 pseudo-options like
<code>--all
</code> and
<code>--glob=
</code>. When a
<code>--
</code> separator
952 is seen, the following input is treated as paths and used to
953 limit the result. Flags like
<code>--not
</code> which are read via standard input
954 are only respected for arguments passed in the same way and will not
955 influence any subsequent command line arguments.
</p>
957 <dt class=
"hdlist1">--cherry-mark
</dt>
959 <p>Like
<code>--cherry-pick
</code> (see below) but mark equivalent commits
960 with
<code>=
</code> rather than omitting them, and inequivalent ones with
<code>+
</code>.
</p>
962 <dt class=
"hdlist1">--cherry-pick
</dt>
964 <p>Omit any commit that introduces the same change as
965 another commit on the
“other side
” when the set of
966 commits are limited with symmetric difference.
</p>
967 <div class=
"paragraph">
968 <p>For example, if you have two branches,
<code>A
</code> and
<code>B
</code>, a usual way
969 to list all commits on only one side of them is with
970 <code>--left-right
</code> (see the example below in the description of
971 the
<code>--left-right
</code> option). However, it shows the commits that were
972 cherry-picked from the other branch (for example,
“3rd on b
” may be
973 cherry-picked from branch A). With this option, such pairs of commits are
974 excluded from the output.
</p>
977 <dt class=
"hdlist1">--left-only
</dt>
978 <dt class=
"hdlist1">--right-only
</dt>
980 <p>List only commits on the respective side of a symmetric difference,
981 i.e. only those which would be marked
<code><</code> resp.
<code>></code> by
982 <code>--left-right
</code>.
</p>
983 <div class=
"paragraph">
984 <p>For example,
<code>--cherry-pick --right-only A...B
</code> omits those
985 commits from
<code>B
</code> which are in
<code>A
</code> or are patch-equivalent to a commit in
986 <code>A
</code>. In other words, this lists the
<code>+
</code> commits from
<code>git cherry A B
</code>.
987 More precisely,
<code>--cherry-pick --right-only --no-merges
</code> gives the exact
991 <dt class=
"hdlist1">--cherry
</dt>
993 <p>A synonym for
<code>--right-only --cherry-mark --no-merges
</code>; useful to
994 limit the output to the commits on our side and mark those that
995 have been applied to the other side of a forked history with
996 <code>git log --cherry upstream...mybranch
</code>, similar to
997 <code>git cherry upstream mybranch
</code>.
</p>
999 <dt class=
"hdlist1">-g
</dt>
1000 <dt class=
"hdlist1">--walk-reflogs
</dt>
1002 <p>Instead of walking the commit ancestry chain, walk
1003 reflog entries from the most recent one to older ones.
1004 When this option is used you cannot specify commits to
1005 exclude (that is,
<em>^commit
</em>,
<em>commit1..commit2
</em>,
1006 and
<em>commit1...commit2
</em> notations cannot be used).
</p>
1007 <div class=
"paragraph">
1008 <p>With
<code>--pretty
</code> format other than
<code>oneline
</code> and
<code>reference
</code> (for obvious reasons),
1009 this causes the output to have two extra lines of information
1010 taken from the reflog. The reflog designator in the output may be shown
1011 as
<code>ref@{
<Nth
>}
</code> (where
<em><Nth
></em> is the reverse-chronological index in the
1012 reflog) or as
<code>ref@{
<timestamp
>}
</code> (with the
<em><timestamp
></em> for that entry),
1013 depending on a few rules:
</p>
1015 <div class=
"openblock">
1016 <div class=
"content">
1017 <div class=
"olist arabic">
1020 <p>If the starting point is specified as
<code>ref@{
<Nth
>}
</code>, show the index
1024 <p>If the starting point was specified as
<code>ref@{now}
</code>, show the
1025 timestamp format.
</p>
1028 <p>If neither was used, but
<code>--date
</code> was given on the command line, show
1029 the timestamp in the format requested by
<code>--date
</code>.
</p>
1032 <p>Otherwise, show the index format.
</p>
1038 <div class=
"paragraph">
1039 <p>Under
<code>--pretty=oneline
</code>, the commit message is
1040 prefixed with this information on the same line.
1041 This option cannot be combined with
<code>--reverse
</code>.
1042 See also
<a href=
"git-reflog.html">git-reflog(
1)
</a>.
</p>
1044 <div class=
"paragraph">
1045 <p>Under
<code>--pretty=reference
</code>, this information will not be shown at all.
</p>
1048 <dt class=
"hdlist1">--merge
</dt>
1050 <p>Show commits touching conflicted paths in the range
<code>HEAD...
<other
></code>,
1051 where
<code><other
></code> is the first existing pseudoref in
<code>MERGE_HEAD
</code>,
1052 <code>CHERRY_PICK_HEAD
</code>,
<code>REVERT_HEAD
</code> or
<code>REBASE_HEAD
</code>. Only works
1053 when the index has unmerged entries. This option can be used to show
1054 relevant commits when resolving conflicts from a
3-way merge.
</p>
1056 <dt class=
"hdlist1">--boundary
</dt>
1058 <p>Output excluded boundary commits. Boundary commits are
1059 prefixed with
<code>-
</code>.
</p>
1065 <h3 id=
"_history_simplification">History Simplification
</h3>
1066 <div class=
"paragraph">
1067 <p>Sometimes you are only interested in parts of the history, for example the
1068 commits modifying a particular
<path
>. But there are two parts of
1069 <em>History Simplification
</em>, one part is selecting the commits and the other
1070 is how to do it, as there are various strategies to simplify the history.
</p>
1072 <div class=
"paragraph">
1073 <p>The following options select the commits to be shown:
</p>
1077 <dt class=
"hdlist1"><paths
></dt>
1079 <p>Commits modifying the given
<paths
> are selected.
</p>
1081 <dt class=
"hdlist1">--simplify-by-decoration
</dt>
1083 <p>Commits that are referred by some branch or tag are selected.
</p>
1087 <div class=
"paragraph">
1088 <p>Note that extra commits can be shown to give a meaningful history.
</p>
1090 <div class=
"paragraph">
1091 <p>The following options affect the way the simplification is performed:
</p>
1095 <dt class=
"hdlist1">Default mode
</dt>
1097 <p>Simplifies the history to the simplest history explaining the
1098 final state of the tree. Simplest because it prunes some side
1099 branches if the end result is the same (i.e. merging branches
1100 with the same content)
</p>
1102 <dt class=
"hdlist1">--show-pulls
</dt>
1104 <p>Include all commits from the default mode, but also any merge
1105 commits that are not TREESAME to the first parent but are
1106 TREESAME to a later parent. This mode is helpful for showing
1107 the merge commits that
"first introduced" a change to a branch.
</p>
1109 <dt class=
"hdlist1">--full-history
</dt>
1111 <p>Same as the default mode, but does not prune some history.
</p>
1113 <dt class=
"hdlist1">--dense
</dt>
1115 <p>Only the selected commits are shown, plus some to have a
1116 meaningful history.
</p>
1118 <dt class=
"hdlist1">--sparse
</dt>
1120 <p>All commits in the simplified history are shown.
</p>
1122 <dt class=
"hdlist1">--simplify-merges
</dt>
1124 <p>Additional option to
<code>--full-history
</code> to remove some needless
1125 merges from the resulting history, as there are no selected
1126 commits contributing to this merge.
</p>
1128 <dt class=
"hdlist1">--ancestry-path[=
<commit
>]
</dt>
1130 <p>When given a range of commits to display (e.g.
<em>commit1..commit2
</em>
1131 or
<em>commit2 ^commit1
</em>), only display commits in that range
1132 that are ancestors of
<commit
>, descendants of
<commit
>, or
1133 <commit
> itself. If no commit is specified, use
<em>commit1
</em> (the
1134 excluded part of the range) as
<commit
>. Can be passed multiple
1135 times; if so, a commit is included if it is any of the commits
1136 given or if it is an ancestor or descendant of one of them.
</p>
1140 <div class=
"paragraph">
1141 <p>A more detailed explanation follows.
</p>
1143 <div class=
"paragraph">
1144 <p>Suppose you specified
<code>foo
</code> as the
<paths
>. We shall call commits
1145 that modify
<code>foo
</code> !TREESAME, and the rest TREESAME. (In a diff
1146 filtered for
<code>foo
</code>, they look different and equal, respectively.)
</p>
1148 <div class=
"paragraph">
1149 <p>In the following, we will always refer to the same example history to
1150 illustrate the differences between simplification settings. We assume
1151 that you are filtering for a file
<code>foo
</code> in this commit graph:
</p>
1153 <div class=
"listingblock">
1154 <div class=
"content">
1155 <pre> .-A---M---N---O---P---Q
1159 `-------------' X
</pre>
1162 <div class=
"paragraph">
1163 <p>The horizontal line of history A---Q is taken to be the first parent of
1164 each merge. The commits are:
</p>
1169 <p><code>I
</code> is the initial commit, in which
<code>foo
</code> exists with contents
1170 “asdf
”, and a file
<code>quux
</code> exists with contents
“quux
”. Initial
1171 commits are compared to an empty tree, so
<code>I
</code> is !TREESAME.
</p>
1174 <p>In
<code>A
</code>,
<code>foo
</code> contains just
“foo
”.
</p>
1177 <p><code>B
</code> contains the same change as
<code>A
</code>. Its merge
<code>M
</code> is trivial and
1178 hence TREESAME to all parents.
</p>
1181 <p><code>C
</code> does not change
<code>foo
</code>, but its merge
<code>N
</code> changes it to
“foobar
”,
1182 so it is not TREESAME to any parent.
</p>
1185 <p><code>D
</code> sets
<code>foo
</code> to
“baz
”. Its merge
<code>O
</code> combines the strings from
1186 <code>N
</code> and
<code>D
</code> to
“foobarbaz
”; i.e., it is not TREESAME to any parent.
</p>
1189 <p><code>E
</code> changes
<code>quux
</code> to
“xyzzy
”, and its merge
<code>P
</code> combines the
1190 strings to
“quux xyzzy
”.
<code>P
</code> is TREESAME to
<code>O
</code>, but not to
<code>E
</code>.
</p>
1193 <p><code>X
</code> is an independent root commit that added a new file
<code>side
</code>, and
<code>Y
</code>
1194 modified it.
<code>Y
</code> is TREESAME to
<code>X
</code>. Its merge
<code>Q
</code> added
<code>side
</code> to
<code>P
</code>, and
1195 <code>Q
</code> is TREESAME to
<code>P
</code>, but not to
<code>Y
</code>.
</p>
1199 <div class=
"paragraph">
1200 <p><code>rev-list
</code> walks backwards through history, including or excluding
1201 commits based on whether
<code>--full-history
</code> and/or parent rewriting
1202 (via
<code>--parents
</code> or
<code>--children
</code>) are used. The following settings
1207 <dt class=
"hdlist1">Default mode
</dt>
1209 <p>Commits are included if they are not TREESAME to any parent
1210 (though this can be changed, see
<code>--sparse
</code> below). If the
1211 commit was a merge, and it was TREESAME to one parent, follow
1212 only that parent. (Even if there are several TREESAME
1213 parents, follow only one of them.) Otherwise, follow all
1215 <div class=
"paragraph">
1216 <p>This results in:
</p>
1218 <div class=
"listingblock">
1219 <div class=
"content">
1225 <div class=
"paragraph">
1226 <p>Note how the rule to only follow the TREESAME parent, if one is
1227 available, removed
<code>B
</code> from consideration entirely.
<code>C
</code> was
1228 considered via
<code>N
</code>, but is TREESAME. Root commits are compared to an
1229 empty tree, so
<code>I
</code> is !TREESAME.
</p>
1231 <div class=
"paragraph">
1232 <p>Parent/child relations are only visible with
<code>--parents
</code>, but that does
1233 not affect the commits selected in default mode, so we have shown the
1237 <dt class=
"hdlist1">--full-history without parent rewriting
</dt>
1239 <p>This mode differs from the default in one point: always follow
1240 all parents of a merge, even if it is TREESAME to one of them.
1241 Even if more than one side of the merge has commits that are
1242 included, this does not imply that the merge itself is! In
1243 the example, we get
</p>
1244 <div class=
"listingblock">
1245 <div class=
"content">
1246 <pre> I A B N D O P Q
</pre>
1249 <div class=
"paragraph">
1250 <p><code>M
</code> was excluded because it is TREESAME to both parents.
<code>E
</code>,
1251 <code>C
</code> and
<code>B
</code> were all walked, but only
<code>B
</code> was !TREESAME, so the others
1254 <div class=
"paragraph">
1255 <p>Note that without parent rewriting, it is not really possible to talk
1256 about the parent/child relationships between the commits, so we show
1257 them disconnected.
</p>
1260 <dt class=
"hdlist1">--full-history with parent rewriting
</dt>
1262 <p>Ordinary commits are only included if they are !TREESAME
1263 (though this can be changed, see
<code>--sparse
</code> below).
</p>
1264 <div class=
"paragraph">
1265 <p>Merges are always included. However, their parent list is rewritten:
1266 Along each parent, prune away commits that are not included
1267 themselves. This results in
</p>
1269 <div class=
"listingblock">
1270 <div class=
"content">
1271 <pre> .-A---M---N---O---P---Q
1275 `-------------'
</pre>
1278 <div class=
"paragraph">
1279 <p>Compare to
<code>--full-history
</code> without rewriting above. Note that
<code>E
</code>
1280 was pruned away because it is TREESAME, but the parent list of P was
1281 rewritten to contain
<code>E
</code>'s parent
<code>I
</code>. The same happened for
<code>C
</code> and
1282 <code>N
</code>, and
<code>X
</code>,
<code>Y
</code> and
<code>Q
</code>.
</p>
1287 <div class=
"paragraph">
1288 <p>In addition to the above settings, you can change whether TREESAME
1289 affects inclusion:
</p>
1293 <dt class=
"hdlist1">--dense
</dt>
1295 <p>Commits that are walked are included if they are not TREESAME
1298 <dt class=
"hdlist1">--sparse
</dt>
1300 <p>All commits that are walked are included.
</p>
1301 <div class=
"paragraph">
1302 <p>Note that without
<code>--full-history
</code>, this still simplifies merges: if
1303 one of the parents is TREESAME, we follow only that one, so the other
1304 sides of the merge are never walked.
</p>
1307 <dt class=
"hdlist1">--simplify-merges
</dt>
1309 <p>First, build a history graph in the same way that
1310 <code>--full-history
</code> with parent rewriting does (see above).
</p>
1311 <div class=
"paragraph">
1312 <p>Then simplify each commit
<code>C
</code> to its replacement
<code>C'
</code> in the final
1313 history according to the following rules:
</p>
1315 <div class=
"openblock">
1316 <div class=
"content">
1320 <p>Set
<code>C'
</code> to
<code>C
</code>.
</p>
1323 <p>Replace each parent
<code>P
</code> of
<code>C'
</code> with its simplification
<code>P'
</code>. In
1324 the process, drop parents that are ancestors of other parents or that are
1325 root commits TREESAME to an empty tree, and remove duplicates, but take care
1326 to never drop all parents that we are TREESAME to.
</p>
1329 <p>If after this parent rewriting,
<code>C'
</code> is a root or merge commit (has
1330 zero or
>1 parents), a boundary commit, or !TREESAME, it remains.
1331 Otherwise, it is replaced with its only parent.
</p>
1337 <div class=
"paragraph">
1338 <p>The effect of this is best shown by way of comparing to
1339 <code>--full-history
</code> with parent rewriting. The example turns into:
</p>
1341 <div class=
"listingblock">
1342 <div class=
"content">
1343 <pre> .-A---M---N---O
1350 <div class=
"paragraph">
1351 <p>Note the major differences in
<code>N
</code>,
<code>P
</code>, and
<code>Q
</code> over
<code>--full-history
</code>:
</p>
1353 <div class=
"openblock">
1354 <div class=
"content">
1358 <p><code>N
</code>'s parent list had
<code>I
</code> removed, because it is an ancestor of the
1359 other parent
<code>M
</code>. Still,
<code>N
</code> remained because it is !TREESAME.
</p>
1362 <p><code>P
</code>'s parent list similarly had
<code>I
</code> removed.
<code>P
</code> was then
1363 removed completely, because it had one parent and is TREESAME.
</p>
1366 <p><code>Q
</code>'s parent list had
<code>Y
</code> simplified to
<code>X
</code>.
<code>X
</code> was then removed, because it
1367 was a TREESAME root.
<code>Q
</code> was then removed completely, because it had one
1368 parent and is TREESAME.
</p>
1377 <div class=
"paragraph">
1378 <p>There is another simplification mode available:
</p>
1382 <dt class=
"hdlist1">--ancestry-path[=
<commit
>]
</dt>
1384 <p>Limit the displayed commits to those which are an ancestor of
1385 <commit
>, or which are a descendant of
<commit
>, or are
<commit
>
1387 <div class=
"paragraph">
1388 <p>As an example use case, consider the following commit history:
</p>
1390 <div class=
"listingblock">
1391 <div class=
"content">
1394 B---C---G---H---I---J
1396 A-------K---------------L--M
</pre>
1399 <div class=
"paragraph">
1400 <p>A regular
<em>D..M
</em> computes the set of commits that are ancestors of
<code>M
</code>,
1401 but excludes the ones that are ancestors of
<code>D
</code>. This is useful to see
1402 what happened to the history leading to
<code>M
</code> since
<code>D
</code>, in the sense
1403 that
“what does
<code>M
</code> have that did not exist in
<code>D
</code>”. The result in this
1404 example would be all the commits, except
<code>A
</code> and
<code>B
</code> (and
<code>D
</code> itself,
1407 <div class=
"paragraph">
1408 <p>When we want to find out what commits in
<code>M
</code> are contaminated with the
1409 bug introduced by
<code>D
</code> and need fixing, however, we might want to view
1410 only the subset of
<em>D..M
</em> that are actually descendants of
<code>D
</code>, i.e.
1411 excluding
<code>C
</code> and
<code>K
</code>. This is exactly what the
<code>--ancestry-path
</code>
1412 option does. Applied to the
<em>D..M
</em> range, it results in:
</p>
1414 <div class=
"listingblock">
1415 <div class=
"content">
1423 <div class=
"paragraph">
1424 <p>We can also use
<code>--ancestry-path=D
</code> instead of
<code>--ancestry-path
</code> which
1425 means the same thing when applied to the
<em>D..M
</em> range but is just more
1428 <div class=
"paragraph">
1429 <p>If we instead are interested in a given topic within this range, and all
1430 commits affected by that topic, we may only want to view the subset of
1431 <code>D..M
</code> which contain that topic in their ancestry path. So, using
1432 <code>--ancestry-path=H D..M
</code> for example would result in:
</p>
1434 <div class=
"listingblock">
1435 <div class=
"content">
1443 <div class=
"paragraph">
1444 <p>Whereas
<code>--ancestry-path=K D..M
</code> would result in
</p>
1446 <div class=
"listingblock">
1447 <div class=
"content">
1448 <pre> K---------------L--M
</pre>
1454 <div class=
"paragraph">
1455 <p>Before discussing another option,
<code>--show-pulls
</code>, we need to
1456 create a new example history.
</p>
1458 <div class=
"paragraph">
1459 <p>A common problem users face when looking at simplified history is that a
1460 commit they know changed a file somehow does not appear in the file
’s
1461 simplified history. Let
’s demonstrate a new example and show how options
1462 such as
<code>--full-history
</code> and
<code>--simplify-merges
</code> works in that case:
</p>
1464 <div class=
"listingblock">
1465 <div class=
"content">
1466 <pre> .-A---M-----C--N---O---P
1471 `---X--' `---Y--'
</pre>
1474 <div class=
"paragraph">
1475 <p>For this example, suppose
<code>I
</code> created
<code>file.txt
</code> which was modified by
1476 <code>A
</code>,
<code>B
</code>, and
<code>X
</code> in different ways. The single-parent commits
<code>C
</code>,
<code>Z
</code>,
1477 and
<code>Y
</code> do not change
<code>file.txt
</code>. The merge commit
<code>M
</code> was created by
1478 resolving the merge conflict to include both changes from
<code>A
</code> and
<code>B
</code>
1479 and hence is not TREESAME to either. The merge commit
<code>R
</code>, however, was
1480 created by ignoring the contents of
<code>file.txt
</code> at
<code>M
</code> and taking only
1481 the contents of
<code>file.txt
</code> at
<code>X
</code>. Hence,
<code>R
</code> is TREESAME to
<code>X
</code> but not
1482 <code>M
</code>. Finally, the natural merge resolution to create
<code>N
</code> is to take the
1483 contents of
<code>file.txt
</code> at
<code>R
</code>, so
<code>N
</code> is TREESAME to
<code>R
</code> but not
<code>C
</code>.
1484 The merge commits
<code>O
</code> and
<code>P
</code> are TREESAME to their first parents, but
1485 not to their second parents,
<code>Z
</code> and
<code>Y
</code> respectively.
</p>
1487 <div class=
"paragraph">
1488 <p>When using the default mode,
<code>N
</code> and
<code>R
</code> both have a TREESAME parent, so
1489 those edges are walked and the others are ignored. The resulting history
1492 <div class=
"listingblock">
1493 <div class=
"content">
1497 <div class=
"paragraph">
1498 <p>When using
<code>--full-history
</code>, Git walks every edge. This will discover
1499 the commits
<code>A
</code> and
<code>B
</code> and the merge
<code>M
</code>, but also will reveal the
1500 merge commits
<code>O
</code> and
<code>P
</code>. With parent rewriting, the resulting graph is:
</p>
1502 <div class=
"listingblock">
1503 <div class=
"content">
1504 <pre> .-A---M--------N---O---P
1509 `---X--' `------'
</pre>
1512 <div class=
"paragraph">
1513 <p>Here, the merge commits
<code>O
</code> and
<code>P
</code> contribute extra noise, as they did
1514 not actually contribute a change to
<code>file.txt
</code>. They only merged a topic
1515 that was based on an older version of
<code>file.txt
</code>. This is a common
1516 issue in repositories using a workflow where many contributors work in
1517 parallel and merge their topic branches along a single trunk: many
1518 unrelated merges appear in the
<code>--full-history
</code> results.
</p>
1520 <div class=
"paragraph">
1521 <p>When using the
<code>--simplify-merges
</code> option, the commits
<code>O
</code> and
<code>P
</code>
1522 disappear from the results. This is because the rewritten second parents
1523 of
<code>O
</code> and
<code>P
</code> are reachable from their first parents. Those edges are
1524 removed and then the commits look like single-parent commits that are
1525 TREESAME to their parent. This also happens to the commit
<code>N
</code>, resulting
1526 in a history view as follows:
</p>
1528 <div class=
"listingblock">
1529 <div class=
"content">
1538 <div class=
"paragraph">
1539 <p>In this view, we see all of the important single-parent changes from
1540 <code>A
</code>,
<code>B
</code>, and
<code>X
</code>. We also see the carefully-resolved merge
<code>M
</code> and the
1541 not-so-carefully-resolved merge
<code>R
</code>. This is usually enough information
1542 to determine why the commits
<code>A
</code> and
<code>B
</code> "disappeared" from history in
1543 the default view. However, there are a few issues with this approach.
</p>
1545 <div class=
"paragraph">
1546 <p>The first issue is performance. Unlike any previous option, the
1547 <code>--simplify-merges
</code> option requires walking the entire commit history
1548 before returning a single result. This can make the option difficult to
1549 use for very large repositories.
</p>
1551 <div class=
"paragraph">
1552 <p>The second issue is one of auditing. When many contributors are working
1553 on the same repository, it is important which merge commits introduced
1554 a change into an important branch. The problematic merge
<code>R
</code> above is
1555 not likely to be the merge commit that was used to merge into an
1556 important branch. Instead, the merge
<code>N
</code> was used to merge
<code>R
</code> and
<code>X
</code>
1557 into the important branch. This commit may have information about why
1558 the change
<code>X
</code> came to override the changes from
<code>A
</code> and
<code>B
</code> in its
1563 <dt class=
"hdlist1">--show-pulls
</dt>
1565 <p>In addition to the commits shown in the default history, show
1566 each merge commit that is not TREESAME to its first parent but
1567 is TREESAME to a later parent.
</p>
1568 <div class=
"paragraph">
1569 <p>When a merge commit is included by
<code>--show-pulls
</code>, the merge is
1570 treated as if it
"pulled" the change from another branch. When using
1571 <code>--show-pulls
</code> on this example (and no other options) the resulting
1574 <div class=
"listingblock">
1575 <div class=
"content">
1576 <pre> I---X---R---N
</pre>
1579 <div class=
"paragraph">
1580 <p>Here, the merge commits
<code>R
</code> and
<code>N
</code> are included because they pulled
1581 the commits
<code>X
</code> and
<code>R
</code> into the base branch, respectively. These
1582 merges are the reason the commits
<code>A
</code> and
<code>B
</code> do not appear in the
1583 default history.
</p>
1585 <div class=
"paragraph">
1586 <p>When
<code>--show-pulls
</code> is paired with
<code>--simplify-merges
</code>, the
1587 graph includes all of the necessary information:
</p>
1589 <div class=
"listingblock">
1590 <div class=
"content">
1599 <div class=
"paragraph">
1600 <p>Notice that since
<code>M
</code> is reachable from
<code>R
</code>, the edge from
<code>N
</code> to
<code>M
</code>
1601 was simplified away. However,
<code>N
</code> still appears in the history as an
1602 important commit because it
"pulled" the change
<code>R
</code> into the main
1608 <div class=
"paragraph">
1609 <p>The
<code>--simplify-by-decoration
</code> option allows you to view only the
1610 big picture of the topology of the history, by omitting commits
1611 that are not referenced by tags. Commits are marked as !TREESAME
1612 (in other words, kept after history simplification rules described
1613 above) if (
1) they are referenced by tags, or (
2) they change the
1614 contents of the paths given on the command line. All other
1615 commits are marked as TREESAME (subject to be simplified away).
</p>
1619 <h3 id=
"_commit_ordering">Commit Ordering
</h3>
1620 <div class=
"paragraph">
1621 <p>By default, the commits are shown in reverse chronological order.
</p>
1625 <dt class=
"hdlist1">--date-order
</dt>
1627 <p>Show no parents before all of its children are shown, but
1628 otherwise show commits in the commit timestamp order.
</p>
1630 <dt class=
"hdlist1">--author-date-order
</dt>
1632 <p>Show no parents before all of its children are shown, but
1633 otherwise show commits in the author timestamp order.
</p>
1635 <dt class=
"hdlist1">--topo-order
</dt>
1637 <p>Show no parents before all of its children are shown, and
1638 avoid showing commits on multiple lines of history
1640 <div class=
"paragraph">
1641 <p>For example, in a commit history like this:
</p>
1643 <div class=
"listingblock">
1644 <div class=
"content">
1645 <pre> ---
1----
2----
4----
7
1647 3----
5----
6----
8---
</pre>
1650 <div class=
"paragraph">
1651 <p>where the numbers denote the order of commit timestamps,
<code>git
1652 rev-list
</code> and friends with
<code>--date-order
</code> show the commits in the
1653 timestamp order:
8 7 6 5 4 3 2 1.
</p>
1655 <div class=
"paragraph">
1656 <p>With
<code>--topo-order
</code>, they would show
8 6 5 3 7 4 2 1 (or
8 7 4 2 6 5
1657 3 1); some older commits are shown before newer ones in order to
1658 avoid showing the commits from two parallel development track mixed
1662 <dt class=
"hdlist1">--reverse
</dt>
1664 <p>Output the commits chosen to be shown (see Commit Limiting
1665 section above) in reverse order. Cannot be combined with
1666 <code>--walk-reflogs
</code>.
</p>
1672 <h3 id=
"_object_traversal">Object Traversal
</h3>
1673 <div class=
"paragraph">
1674 <p>These options are mostly targeted for packing of Git repositories.
</p>
1678 <dt class=
"hdlist1">--no-walk[=(sorted|unsorted)]
</dt>
1680 <p>Only show the given commits, but do not traverse their ancestors.
1681 This has no effect if a range is specified. If the argument
1682 <code>unsorted
</code> is given, the commits are shown in the order they were
1683 given on the command line. Otherwise (if
<code>sorted
</code> or no argument
1684 was given), the commits are shown in reverse chronological order
1686 Cannot be combined with
<code>--graph
</code>.
</p>
1688 <dt class=
"hdlist1">--do-walk
</dt>
1690 <p>Overrides a previous
<code>--no-walk
</code>.
</p>
1696 <h3 id=
"_commit_formatting">Commit Formatting
</h3>
1699 <dt class=
"hdlist1">--pretty[=
<format
>]
</dt>
1700 <dt class=
"hdlist1">--format=
<format
></dt>
1702 <p>Pretty-print the contents of the commit logs in a given format,
1703 where
<em><format
></em> can be one of
<em>oneline
</em>,
<em>short
</em>,
<em>medium
</em>,
1704 <em>full
</em>,
<em>fuller
</em>,
<em>reference
</em>,
<em>email
</em>,
<em>raw
</em>,
<em>format:
<string
></em>
1705 and
<em>tformat:
<string
></em>. When
<em><format
></em> is none of the above,
1706 and has
<em>%placeholder
</em> in it, it acts as if
1707 <em>--pretty=tformat:
<format
></em> were given.
</p>
1708 <div class=
"paragraph">
1709 <p>See the
"PRETTY FORMATS" section for some additional details for each
1710 format. When
<em>=
<format
></em> part is omitted, it defaults to
<em>medium
</em>.
</p>
1712 <div class=
"paragraph">
1713 <p>Note: you can specify the default pretty format in the repository
1714 configuration (see
<a href=
"git-config.html">git-config(
1)
</a>).
</p>
1717 <dt class=
"hdlist1">--abbrev-commit
</dt>
1719 <p>Instead of showing the full
40-byte hexadecimal commit object
1720 name, show a prefix that names the object uniquely.
1721 "--abbrev=<n>" (which also modifies diff output, if it is displayed)
1722 option can be used to specify the minimum length of the prefix.
</p>
1723 <div class=
"paragraph">
1724 <p>This should make
"--pretty=oneline" a whole lot more readable for
1725 people using
80-column terminals.
</p>
1728 <dt class=
"hdlist1">--no-abbrev-commit
</dt>
1730 <p>Show the full
40-byte hexadecimal commit object name. This negates
1731 <code>--abbrev-commit
</code>, either explicit or implied by other options such
1732 as
"--oneline". It also overrides the
<code>log.abbrevCommit
</code> variable.
</p>
1734 <dt class=
"hdlist1">--oneline
</dt>
1736 <p>This is a shorthand for
"--pretty=oneline --abbrev-commit"
1739 <dt class=
"hdlist1">--encoding=
<encoding
></dt>
1741 <p>Commit objects record the character encoding used for the log message
1742 in their encoding header; this option can be used to tell the
1743 command to re-code the commit log message in the encoding
1744 preferred by the user. For non plumbing commands this
1745 defaults to UTF-
8. Note that if an object claims to be encoded
1746 in
<code>X
</code> and we are outputting in
<code>X
</code>, we will output the object
1747 verbatim; this means that invalid sequences in the original
1748 commit may be copied to the output. Likewise, if iconv(
3) fails
1749 to convert the commit, we will quietly output the original
1750 object verbatim.
</p>
1752 <dt class=
"hdlist1">--expand-tabs=
<n
></dt>
1753 <dt class=
"hdlist1">--expand-tabs
</dt>
1754 <dt class=
"hdlist1">--no-expand-tabs
</dt>
1756 <p>Perform a tab expansion (replace each tab with enough spaces
1757 to fill to the next display column that is a multiple of
<em><n
></em>)
1758 in the log message before showing it in the output.
1759 <code>--expand-tabs
</code> is a short-hand for
<code>--expand-tabs=
8</code>, and
1760 <code>--no-expand-tabs
</code> is a short-hand for
<code>--expand-tabs=
0</code>,
1761 which disables tab expansion.
</p>
1762 <div class=
"paragraph">
1763 <p>By default, tabs are expanded in pretty formats that indent the log
1764 message by
4 spaces (i.e.
<em>medium
</em>, which is the default,
<em>full
</em>,
1765 and
<em>fuller
</em>).
</p>
1768 <dt class=
"hdlist1">--notes[=
<ref
>]
</dt>
1770 <p>Show the notes (see
<a href=
"git-notes.html">git-notes(
1)
</a>) that annotate the
1771 commit, when showing the commit log message. This is the default
1772 for
<code>git log
</code>,
<code>git show
</code> and
<code>git whatchanged
</code> commands when
1773 there is no
<code>--pretty
</code>,
<code>--format
</code>, or
<code>--oneline
</code> option given
1774 on the command line.
</p>
1775 <div class=
"paragraph">
1776 <p>By default, the notes shown are from the notes refs listed in the
1777 <code>core.notesRef
</code> and
<code>notes.displayRef
</code> variables (or corresponding
1778 environment overrides). See
<a href=
"git-config.html">git-config(
1)
</a> for more details.
</p>
1780 <div class=
"paragraph">
1781 <p>With an optional
<em><ref
></em> argument, use the ref to find the notes
1782 to display. The ref can specify the full refname when it begins
1783 with
<code>refs/notes/
</code>; when it begins with
<code>notes/
</code>,
<code>refs/
</code> and otherwise
1784 <code>refs/notes/
</code> is prefixed to form the full name of the ref.
</p>
1786 <div class=
"paragraph">
1787 <p>Multiple --notes options can be combined to control which notes are
1788 being displayed. Examples:
"--notes=foo" will show only notes from
1789 "refs/notes/foo";
"--notes=foo --notes" will show both notes from
1790 "refs/notes/foo" and from the default notes ref(s).
</p>
1793 <dt class=
"hdlist1">--no-notes
</dt>
1795 <p>Do not show notes. This negates the above
<code>--notes
</code> option, by
1796 resetting the list of notes refs from which notes are shown.
1797 Options are parsed in the order given on the command line, so e.g.
1798 "--notes --notes=foo --no-notes --notes=bar" will only show notes
1799 from
"refs/notes/bar".
</p>
1801 <dt class=
"hdlist1">--show-notes-by-default
</dt>
1803 <p>Show the default notes unless options for displaying specific
1804 notes are given.
</p>
1806 <dt class=
"hdlist1">--show-notes[=
<ref
>]
</dt>
1807 <dt class=
"hdlist1">--[no-]standard-notes
</dt>
1809 <p>These options are deprecated. Use the above --notes/--no-notes
1810 options instead.
</p>
1812 <dt class=
"hdlist1">--show-signature
</dt>
1814 <p>Check the validity of a signed commit object by passing the signature
1815 to
<code>gpg --verify
</code> and show the output.
</p>
1817 <dt class=
"hdlist1">--relative-date
</dt>
1819 <p>Synonym for
<code>--date=relative
</code>.
</p>
1821 <dt class=
"hdlist1">--date=
<format
></dt>
1823 <p>Only takes effect for dates shown in human-readable format, such
1824 as when using
<code>--pretty
</code>.
<code>log.date
</code> config variable sets a default
1825 value for the log command
’s
<code>--date
</code> option. By default, dates
1826 are shown in the original time zone (either committer
’s or
1827 author
’s). If
<code>-local
</code> is appended to the format (e.g.,
1828 <code>iso-local
</code>), the user
’s local time zone is used instead.
</p>
1829 <div class=
"openblock">
1830 <div class=
"content">
1831 <div class=
"paragraph">
1832 <p><code>--date=relative
</code> shows dates relative to the current time,
1833 e.g.
“2 hours ago
”. The
<code>-local
</code> option has no effect for
1834 <code>--date=relative
</code>.
</p>
1836 <div class=
"paragraph">
1837 <p><code>--date=local
</code> is an alias for
<code>--date=default-local
</code>.
</p>
1839 <div class=
"paragraph">
1840 <p><code>--date=iso
</code> (or
<code>--date=iso8601
</code>) shows timestamps in a ISO
8601-like format.
1841 The differences to the strict ISO
8601 format are:
</p>
1846 <p>a space instead of the
<code>T
</code> date/time delimiter
</p>
1849 <p>a space between time and time zone
</p>
1852 <p>no colon between hours and minutes of the time zone
</p>
1856 <div class=
"paragraph">
1857 <p><code>--date=iso-strict
</code> (or
<code>--date=iso8601-strict
</code>) shows timestamps in strict
1858 ISO
8601 format.
</p>
1860 <div class=
"paragraph">
1861 <p><code>--date=rfc
</code> (or
<code>--date=rfc2822
</code>) shows timestamps in RFC
2822
1862 format, often found in email messages.
</p>
1864 <div class=
"paragraph">
1865 <p><code>--date=short
</code> shows only the date, but not the time, in
<code>YYYY-MM-DD
</code> format.
</p>
1867 <div class=
"paragraph">
1868 <p><code>--date=raw
</code> shows the date as seconds since the epoch (
1970-
01-
01
1869 00:
00:
00 UTC), followed by a space, and then the timezone as an offset
1870 from UTC (a
<code>+
</code> or
<code>-
</code> with four digits; the first two are hours, and
1871 the second two are minutes). I.e., as if the timestamp were formatted
1872 with
<code>strftime(
"%s %z")
</code>).
1873 Note that the
<code>-local
</code> option does not affect the seconds-since-epoch
1874 value (which is always measured in UTC), but does switch the accompanying
1877 <div class=
"paragraph">
1878 <p><code>--date=human
</code> shows the timezone if the timezone does not match the
1879 current time-zone, and doesn
’t print the whole date if that matches
1880 (ie skip printing year for dates that are
"this year", but also skip
1881 the whole date itself if it
’s in the last few days and we can just say
1882 what weekday it was). For older dates the hour and minute is also
1885 <div class=
"paragraph">
1886 <p><code>--date=unix
</code> shows the date as a Unix epoch timestamp (seconds since
1887 1970). As with
<code>--raw
</code>, this is always in UTC and therefore
<code>-local
</code>
1890 <div class=
"paragraph">
1891 <p><code>--date=format:...
</code> feeds the format
<code>...
</code> to your system
<code>strftime
</code>,
1892 except for %s, %z, and %Z, which are handled internally.
1893 Use
<code>--date=format:%c
</code> to show the date in your system locale
’s
1894 preferred format. See the
<code>strftime
</code> manual for a complete list of
1895 format placeholders. When using
<code>-local
</code>, the correct syntax is
1896 <code>--date=format-local:...
</code>.
</p>
1898 <div class=
"paragraph">
1899 <p><code>--date=default
</code> is the default format, and is based on ctime(
3)
1900 output. It shows a single line with three-letter day of the week,
1901 three-letter month, day-of-month, hour-minute-seconds in
"HH:MM:SS"
1902 format, followed by
4-digit year, plus timezone information, unless
1903 the local time zone is used, e.g.
<code>Thu Jan
1 00:
00:
00 1970 +
0000</code>.
</p>
1908 <dt class=
"hdlist1">--parents
</dt>
1910 <p>Print also the parents of the commit (in the form
"commit parent…​").
1911 Also enables parent rewriting, see
<em>History Simplification
</em> above.
</p>
1913 <dt class=
"hdlist1">--children
</dt>
1915 <p>Print also the children of the commit (in the form
"commit child…​").
1916 Also enables parent rewriting, see
<em>History Simplification
</em> above.
</p>
1918 <dt class=
"hdlist1">--left-right
</dt>
1920 <p>Mark which side of a symmetric difference a commit is reachable from.
1921 Commits from the left side are prefixed with
<code><</code> and those from
1922 the right with
<code>></code>. If combined with
<code>--boundary
</code>, those
1923 commits are prefixed with
<code>-
</code>.
</p>
1924 <div class=
"paragraph">
1925 <p>For example, if you have this topology:
</p>
1927 <div class=
"listingblock">
1928 <div class=
"content">
1929 <pre> y---b---b branch B
1933 o---x---a---a branch A
</pre>
1936 <div class=
"paragraph">
1937 <p>you would get an output like this:
</p>
1939 <div class=
"listingblock">
1940 <div class=
"content">
1941 <pre> $ git rev-list --left-right --boundary --pretty=oneline A...B
1943 >bbbbbbb...
3rd on b
1944 >bbbbbbb...
2nd on b
1945 <aaaaaaa...
3rd on a
1946 <aaaaaaa...
2nd on a
1947 -yyyyyyy...
1st on b
1948 -xxxxxxx...
1st on a
</pre>
1952 <dt class=
"hdlist1">--graph
</dt>
1954 <p>Draw a text-based graphical representation of the commit history
1955 on the left hand side of the output. This may cause extra lines
1956 to be printed in between commits, in order for the graph history
1957 to be drawn properly.
1958 Cannot be combined with
<code>--no-walk
</code>.
</p>
1959 <div class=
"paragraph">
1960 <p>This enables parent rewriting, see
<em>History Simplification
</em> above.
</p>
1962 <div class=
"paragraph">
1963 <p>This implies the
<code>--topo-order
</code> option by default, but the
1964 <code>--date-order
</code> option may also be specified.
</p>
1967 <dt class=
"hdlist1">--show-linear-break[=
<barrier
>]
</dt>
1969 <p>When --graph is not used, all history branches are flattened
1970 which can make it hard to see that the two consecutive commits
1971 do not belong to a linear branch. This option puts a barrier
1972 in between them in that case. If
<code><barrier
></code> is specified, it
1973 is the string that will be shown instead of the default one.
</p>
1981 <h2 id=
"_pretty_formats">PRETTY FORMATS
</h2>
1982 <div class=
"sectionbody">
1983 <div class=
"paragraph">
1984 <p>If the commit is a merge, and if the pretty-format
1985 is not
<em>oneline
</em>,
<em>email
</em> or
<em>raw
</em>, an additional line is
1986 inserted before the
<em>Author:
</em> line. This line begins with
1987 "Merge: " and the hashes of ancestral commits are printed,
1988 separated by spaces. Note that the listed commits may not
1989 necessarily be the list of the
<strong>direct
</strong> parent commits if you
1990 have limited your view of history: for example, if you are
1991 only interested in changes related to a certain directory or
1994 <div class=
"paragraph">
1995 <p>There are several built-in formats, and you can define
1996 additional formats by setting a pretty.
<name
>
1997 config option to either another format name, or a
1998 <em>format:
</em> string, as described below (see
1999 <a href=
"git-config.html">git-config(
1)
</a>). Here are the details of the
2000 built-in formats:
</p>
2005 <p><em>oneline
</em></p>
2006 <div class=
"literalblock">
2007 <div class=
"content">
2008 <pre><hash
> <title-line
></pre>
2011 <div class=
"paragraph">
2012 <p>This is designed to be as compact as possible.
</p>
2016 <p><em>short
</em></p>
2017 <div class=
"literalblock">
2018 <div class=
"content">
2019 <pre>commit
<hash
>
2020 Author:
<author
></pre>
2023 <div class=
"literalblock">
2024 <div class=
"content">
2025 <pre><title-line
></pre>
2030 <p><em>medium
</em></p>
2031 <div class=
"literalblock">
2032 <div class=
"content">
2033 <pre>commit
<hash
>
2034 Author:
<author
>
2035 Date:
<author-date
></pre>
2038 <div class=
"literalblock">
2039 <div class=
"content">
2040 <pre><title-line
></pre>
2043 <div class=
"literalblock">
2044 <div class=
"content">
2045 <pre><full-commit-message
></pre>
2050 <p><em>full
</em></p>
2051 <div class=
"literalblock">
2052 <div class=
"content">
2053 <pre>commit
<hash
>
2054 Author:
<author
>
2055 Commit:
<committer
></pre>
2058 <div class=
"literalblock">
2059 <div class=
"content">
2060 <pre><title-line
></pre>
2063 <div class=
"literalblock">
2064 <div class=
"content">
2065 <pre><full-commit-message
></pre>
2070 <p><em>fuller
</em></p>
2071 <div class=
"literalblock">
2072 <div class=
"content">
2073 <pre>commit
<hash
>
2074 Author:
<author
>
2075 AuthorDate:
<author-date
>
2076 Commit:
<committer
>
2077 CommitDate:
<committer-date
></pre>
2080 <div class=
"literalblock">
2081 <div class=
"content">
2082 <pre><title-line
></pre>
2085 <div class=
"literalblock">
2086 <div class=
"content">
2087 <pre><full-commit-message
></pre>
2092 <p><em>reference
</em></p>
2093 <div class=
"literalblock">
2094 <div class=
"content">
2095 <pre><abbrev-hash
> (
<title-line
>,
<short-author-date
>)
</pre>
2098 <div class=
"paragraph">
2099 <p>This format is used to refer to another commit in a commit message and
2100 is the same as
<code>--pretty='format:%C(auto)%h (%s, %ad)'
</code>. By default,
2101 the date is formatted with
<code>--date=short
</code> unless another
<code>--date
</code> option
2102 is explicitly specified. As with any
<code>format:
</code> with format
2103 placeholders, its output is not affected by other options like
2104 <code>--decorate
</code> and
<code>--walk-reflogs
</code>.
</p>
2108 <p><em>email
</em></p>
2109 <div class=
"literalblock">
2110 <div class=
"content">
2111 <pre>From
<hash
> <date
>
2112 From:
<author
>
2113 Date:
<author-date
>
2114 Subject: [PATCH]
<title-line
></pre>
2117 <div class=
"literalblock">
2118 <div class=
"content">
2119 <pre><full-commit-message
></pre>
2124 <p><em>mboxrd
</em></p>
2125 <div class=
"paragraph">
2126 <p>Like
<em>email
</em>, but lines in the commit message starting with
"From "
2127 (preceded by zero or more
">") are quoted with
">" so they aren
’t
2128 confused as starting a new commit.
</p>
2133 <div class=
"paragraph">
2134 <p>The
<em>raw
</em> format shows the entire commit exactly as
2135 stored in the commit object. Notably, the hashes are
2136 displayed in full, regardless of whether --abbrev or
2137 --no-abbrev are used, and
<em>parents
</em> information show the
2138 true parent commits, without taking grafts or history
2139 simplification into account. Note that this format affects the way
2140 commits are displayed, but not the way the diff is shown e.g. with
2141 <code>git log --raw
</code>. To get full object names in a raw diff format,
2142 use
<code>--no-abbrev
</code>.
</p>
2146 <p><em>format:
<format-string
></em></p>
2147 <div class=
"paragraph">
2148 <p>The
<em>format:
<format-string
></em> format allows you to specify which information
2149 you want to show. It works a little bit like printf format,
2150 with the notable exception that you get a newline with
<em>%n
</em>
2151 instead of
<em>\n
</em>.
</p>
2153 <div class=
"paragraph">
2154 <p>E.g,
<em>format:
"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em>
2155 would show something like this:
</p>
2157 <div class=
"listingblock">
2158 <div class=
"content">
2159 <pre>The author of fe6e0ee was Junio C Hamano,
23 hours ago
2160 The title was
>>t4119: test autocomputing -p
<n
> for traditional diff input.
<<</pre>
2163 <div class=
"paragraph">
2164 <p>The placeholders are:
</p>
2169 <p>Placeholders that expand to a single literal character:
</p>
2172 <dt class=
"hdlist1"><em>%n
</em></dt>
2176 <dt class=
"hdlist1"><em>%%
</em></dt>
2178 <p>a raw
<em>%
</em></p>
2180 <dt class=
"hdlist1"><em>%x00
</em></dt>
2182 <p><em>%x
</em> followed by two hexadecimal digits is replaced with a
2183 byte with the hexadecimal digits' value (we will call this
2184 "literal formatting code" in the rest of this document).
</p>
2190 <p>Placeholders that affect formatting of later placeholders:
</p>
2193 <dt class=
"hdlist1"><em>%Cred
</em></dt>
2195 <p>switch color to red
</p>
2197 <dt class=
"hdlist1"><em>%Cgreen
</em></dt>
2199 <p>switch color to green
</p>
2201 <dt class=
"hdlist1"><em>%Cblue
</em></dt>
2203 <p>switch color to blue
</p>
2205 <dt class=
"hdlist1"><em>%Creset
</em></dt>
2209 <dt class=
"hdlist1"><em>%C(
…​)
</em></dt>
2211 <p>color specification, as described under Values in the
2212 "CONFIGURATION FILE" section of
<a href=
"git-config.html">git-config(
1)
</a>. By
2213 default, colors are shown only when enabled for log output
2214 (by
<code>color.diff
</code>,
<code>color.ui
</code>, or
<code>--color
</code>, and respecting
2215 the
<code>auto
</code> settings of the former if we are going to a
2216 terminal).
<code>%C(auto,...)
</code> is accepted as a historical
2217 synonym for the default (e.g.,
<code>%C(auto,red)
</code>). Specifying
2218 <code>%C(always,...)
</code> will show the colors even when color is
2219 not otherwise enabled (though consider just using
2220 <code>--color=always
</code> to enable color for the whole output,
2221 including this format and anything else git might color).
2222 <code>auto
</code> alone (i.e.
<code>%C(auto)
</code>) will turn on auto coloring
2223 on the next placeholders until the color is switched
2226 <dt class=
"hdlist1"><em>%m
</em></dt>
2228 <p>left (
<code><</code>), right (
<code>></code>) or boundary (
<code>-
</code>) mark
</p>
2230 <dt class=
"hdlist1"><em>%w([
<w
>[,
<i1
>[,
<i2
>]]])
</em></dt>
2232 <p>switch line wrapping, like the -w option of
2233 <a href=
"git-shortlog.html">git-shortlog(
1)
</a>.
</p>
2235 <dt class=
"hdlist1"><em>%
<(
<N
> [,trunc|ltrunc|mtrunc])
</em></dt>
2237 <p>make the next placeholder take at
2238 least N column widths, padding spaces on
2239 the right if necessary. Optionally
2240 truncate (with ellipsis
<em>..
</em>) at the left (ltrunc)
<code>..ft
</code>,
2241 the middle (mtrunc)
<code>mi..le
</code>, or the end
2242 (trunc)
<code>rig..
</code>, if the output is longer than
2244 Note
1: that truncating
2245 only works correctly with N
>=
2.
2246 Note
2: spaces around the N and M (see below)
2247 values are optional.
2248 Note
3: Emojis and other wide characters
2249 will take two display columns, which may
2250 over-run column boundaries.
2251 Note
4: decomposed character combining marks
2252 may be misplaced at padding boundaries.
</p>
2254 <dt class=
"hdlist1"><em>%
<|(
<M
> )
</em></dt>
2256 <p>make the next placeholder take at least until Mth
2257 display column, padding spaces on the right if necessary.
2258 Use negative M values for column positions measured
2259 from the right hand edge of the terminal window.
</p>
2261 <dt class=
"hdlist1"><em>%
>(
<N
> )
</em>,
<em>%
>|(
<M
> )
</em></dt>
2263 <p>similar to
<em>%
<(
<N
> )
</em>,
<em>%
<|(
<M
> )
</em> respectively,
2264 but padding spaces on the left
</p>
2266 <dt class=
"hdlist1"><em>%
>>(
<N
> )
</em>,
<em>%
>>|(
<M
> )
</em></dt>
2268 <p>similar to
<em>%
>(
<N
> )
</em>,
<em>%
>|(
<M
> )
</em>
2269 respectively, except that if the next
2270 placeholder takes more spaces than given and
2271 there are spaces on its left, use those
2274 <dt class=
"hdlist1"><em>%
><(
<N
> )
</em>,
<em>%
><|(
<M
> )
</em></dt>
2276 <p>similar to
<em>%
<(
<N
> )
</em>,
<em>%
<|(
<M
> )
</em>
2277 respectively, but padding both sides
2278 (i.e. the text is centered)
</p>
2284 <p>Placeholders that expand to information extracted from the commit:
</p>
2287 <dt class=
"hdlist1"><em>%H
</em></dt>
2291 <dt class=
"hdlist1"><em>%h
</em></dt>
2293 <p>abbreviated commit hash
</p>
2295 <dt class=
"hdlist1"><em>%T
</em></dt>
2299 <dt class=
"hdlist1"><em>%t
</em></dt>
2301 <p>abbreviated tree hash
</p>
2303 <dt class=
"hdlist1"><em>%P
</em></dt>
2305 <p>parent hashes
</p>
2307 <dt class=
"hdlist1"><em>%p
</em></dt>
2309 <p>abbreviated parent hashes
</p>
2311 <dt class=
"hdlist1"><em>%an
</em></dt>
2315 <dt class=
"hdlist1"><em>%aN
</em></dt>
2317 <p>author name (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a>
2318 or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2320 <dt class=
"hdlist1"><em>%ae
</em></dt>
2324 <dt class=
"hdlist1"><em>%aE
</em></dt>
2326 <p>author email (respecting .mailmap, see
<a href=
"git-shortlog.html">git-shortlog(
1)
</a>
2327 or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2329 <dt class=
"hdlist1"><em>%al
</em></dt>
2331 <p>author email local-part (the part before the
<em>@
</em> sign)
</p>
2333 <dt class=
"hdlist1"><em>%aL
</em></dt>
2335 <p>author local-part (see
<em>%al
</em>) respecting .mailmap, see
2336 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2338 <dt class=
"hdlist1"><em>%ad
</em></dt>
2340 <p>author date (format respects --date= option)
</p>
2342 <dt class=
"hdlist1"><em>%aD
</em></dt>
2344 <p>author date, RFC2822 style
</p>
2346 <dt class=
"hdlist1"><em>%ar
</em></dt>
2348 <p>author date, relative
</p>
2350 <dt class=
"hdlist1"><em>%at
</em></dt>
2352 <p>author date, UNIX timestamp
</p>
2354 <dt class=
"hdlist1"><em>%ai
</em></dt>
2356 <p>author date, ISO
8601-like format
</p>
2358 <dt class=
"hdlist1"><em>%aI
</em></dt>
2360 <p>author date, strict ISO
8601 format
</p>
2362 <dt class=
"hdlist1"><em>%as
</em></dt>
2364 <p>author date, short format (
<code>YYYY-MM-DD
</code>)
</p>
2366 <dt class=
"hdlist1"><em>%ah
</em></dt>
2368 <p>author date, human style (like the
<code>--date=human
</code> option of
2369 <a href=
"git-rev-list.html">git-rev-list(
1)
</a>)
</p>
2371 <dt class=
"hdlist1"><em>%cn
</em></dt>
2373 <p>committer name
</p>
2375 <dt class=
"hdlist1"><em>%cN
</em></dt>
2377 <p>committer name (respecting .mailmap, see
2378 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2380 <dt class=
"hdlist1"><em>%ce
</em></dt>
2382 <p>committer email
</p>
2384 <dt class=
"hdlist1"><em>%cE
</em></dt>
2386 <p>committer email (respecting .mailmap, see
2387 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2389 <dt class=
"hdlist1"><em>%cl
</em></dt>
2391 <p>committer email local-part (the part before the
<em>@
</em> sign)
</p>
2393 <dt class=
"hdlist1"><em>%cL
</em></dt>
2395 <p>committer local-part (see
<em>%cl
</em>) respecting .mailmap, see
2396 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2398 <dt class=
"hdlist1"><em>%cd
</em></dt>
2400 <p>committer date (format respects --date= option)
</p>
2402 <dt class=
"hdlist1"><em>%cD
</em></dt>
2404 <p>committer date, RFC2822 style
</p>
2406 <dt class=
"hdlist1"><em>%cr
</em></dt>
2408 <p>committer date, relative
</p>
2410 <dt class=
"hdlist1"><em>%ct
</em></dt>
2412 <p>committer date, UNIX timestamp
</p>
2414 <dt class=
"hdlist1"><em>%ci
</em></dt>
2416 <p>committer date, ISO
8601-like format
</p>
2418 <dt class=
"hdlist1"><em>%cI
</em></dt>
2420 <p>committer date, strict ISO
8601 format
</p>
2422 <dt class=
"hdlist1"><em>%cs
</em></dt>
2424 <p>committer date, short format (
<code>YYYY-MM-DD
</code>)
</p>
2426 <dt class=
"hdlist1"><em>%ch
</em></dt>
2428 <p>committer date, human style (like the
<code>--date=human
</code> option of
2429 <a href=
"git-rev-list.html">git-rev-list(
1)
</a>)
</p>
2431 <dt class=
"hdlist1"><em>%d
</em></dt>
2433 <p>ref names, like the --decorate option of
<a href=
"git-log.html">git-log(
1)
</a></p>
2435 <dt class=
"hdlist1"><em>%D
</em></dt>
2437 <p>ref names without the
" (",
")" wrapping.
</p>
2439 <dt class=
"hdlist1"><em>%(decorate[:
<options
>])
</em></dt>
2441 <p>ref names with custom decorations. The
<code>decorate
</code> string may be followed by a
2442 colon and zero or more comma-separated options. Option values may contain
2443 literal formatting codes. These must be used for commas (
<code>%x2C
</code>) and closing
2444 parentheses (
<code>%x29
</code>), due to their role in the option syntax.
</p>
2448 <p><em>prefix=
<value
></em>: Shown before the list of ref names. Defaults to
" <code>(</code>".
</p>
2451 <p><em>suffix=
<value
></em>: Shown after the list of ref names. Defaults to
"<code>)</code>".
</p>
2454 <p><em>separator=
<value
></em>: Shown between ref names. Defaults to
"<code>,</code> ".
</p>
2457 <p><em>pointer=
<value
></em>: Shown between HEAD and the branch it points to, if any.
2458 Defaults to
" <code>-></code> ".
</p>
2461 <p><em>tag=
<value
></em>: Shown before tag names. Defaults to
"<code>tag:</code> ".
</p>
2471 <div class=
"paragraph">
2472 <p>For example, to produce decorations with no wrapping
2473 or tag annotations, and spaces as separators:
</p>
2475 <div class=
"paragraph">
2477 <code>%(decorate:prefix=,suffix=,tag=,separator= )
</code></p>
2481 <dt class=
"hdlist1"><em>%(describe[:
<options
>])
</em></dt>
2483 <p>human-readable name, like
<a href=
"git-describe.html">git-describe(
1)
</a>; empty string for
2484 undescribable commits. The
<code>describe
</code> string may be followed by a colon and
2485 zero or more comma-separated options. Descriptions can be inconsistent when
2486 tags are added or removed at the same time.
</p>
2490 <p><em>tags[=
<bool-value
>]
</em>: Instead of only considering annotated tags,
2491 consider lightweight tags as well.
</p>
2494 <p><em>abbrev=
<number
></em>: Instead of using the default number of hexadecimal digits
2495 (which will vary according to the number of objects in the repository with a
2496 default of
7) of the abbreviated object name, use
<number
> digits, or as many
2497 digits as needed to form a unique object name.
</p>
2500 <p><em>match=
<pattern
></em>: Only consider tags matching the given
2501 <code>glob(
7)
</code> pattern, excluding the
"refs/tags/" prefix.
</p>
2504 <p><em>exclude=
<pattern
></em>: Do not consider tags matching the given
2505 <code>glob(
7)
</code> pattern, excluding the
"refs/tags/" prefix.
</p>
2510 <dt class=
"hdlist1"><em>%S
</em></dt>
2512 <p>ref name given on the command line by which the commit was reached
2513 (like
<code>git log --source
</code>), only works with
<code>git log
</code></p>
2515 <dt class=
"hdlist1"><em>%e
</em></dt>
2519 <dt class=
"hdlist1"><em>%s
</em></dt>
2523 <dt class=
"hdlist1"><em>%f
</em></dt>
2525 <p>sanitized subject line, suitable for a filename
</p>
2527 <dt class=
"hdlist1"><em>%b
</em></dt>
2531 <dt class=
"hdlist1"><em>%B
</em></dt>
2533 <p>raw body (unwrapped subject and body)
</p>
2535 <dt class=
"hdlist1"><em>%N
</em></dt>
2539 <dt class=
"hdlist1"><em>%GG
</em></dt>
2541 <p>raw verification message from GPG for a signed commit
</p>
2543 <dt class=
"hdlist1"><em>%G?
</em></dt>
2545 <p>show
"G" for a good (valid) signature,
2546 "B" for a bad signature,
2547 "U" for a good signature with unknown validity,
2548 "X" for a good signature that has expired,
2549 "Y" for a good signature made by an expired key,
2550 "R" for a good signature made by a revoked key,
2551 "E" if the signature cannot be checked (e.g. missing key)
2552 and
"N" for no signature
</p>
2554 <dt class=
"hdlist1"><em>%GS
</em></dt>
2556 <p>show the name of the signer for a signed commit
</p>
2558 <dt class=
"hdlist1"><em>%GK
</em></dt>
2560 <p>show the key used to sign a signed commit
</p>
2562 <dt class=
"hdlist1"><em>%GF
</em></dt>
2564 <p>show the fingerprint of the key used to sign a signed commit
</p>
2566 <dt class=
"hdlist1"><em>%GP
</em></dt>
2568 <p>show the fingerprint of the primary key whose subkey was used
2569 to sign a signed commit
</p>
2571 <dt class=
"hdlist1"><em>%GT
</em></dt>
2573 <p>show the trust level for the key used to sign a signed commit
</p>
2575 <dt class=
"hdlist1"><em>%gD
</em></dt>
2577 <p>reflog selector, e.g.,
<code>refs/stash@{
1}
</code> or
<code>refs/stash@{
2
2578 minutes ago}
</code>; the format follows the rules described for the
2579 <code>-g
</code> option. The portion before the
<code>@
</code> is the refname as
2580 given on the command line (so
<code>git log -g refs/heads/master
</code>
2581 would yield
<code>refs/heads/master@{
0}
</code>).
</p>
2583 <dt class=
"hdlist1"><em>%gd
</em></dt>
2585 <p>shortened reflog selector; same as
<code>%gD
</code>, but the refname
2586 portion is shortened for human readability (so
2587 <code>refs/heads/master
</code> becomes just
<code>master
</code>).
</p>
2589 <dt class=
"hdlist1"><em>%gn
</em></dt>
2591 <p>reflog identity name
</p>
2593 <dt class=
"hdlist1"><em>%gN
</em></dt>
2595 <p>reflog identity name (respecting .mailmap, see
2596 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2598 <dt class=
"hdlist1"><em>%ge
</em></dt>
2600 <p>reflog identity email
</p>
2602 <dt class=
"hdlist1"><em>%gE
</em></dt>
2604 <p>reflog identity email (respecting .mailmap, see
2605 <a href=
"git-shortlog.html">git-shortlog(
1)
</a> or
<a href=
"git-blame.html">git-blame(
1)
</a>)
</p>
2607 <dt class=
"hdlist1"><em>%gs
</em></dt>
2609 <p>reflog subject
</p>
2611 <dt class=
"hdlist1"><em>%(trailers[:
<options
>])
</em></dt>
2613 <p>display the trailers of the body as interpreted by
2614 <a href=
"git-interpret-trailers.html">git-interpret-trailers(
1)
</a>. The
<code>trailers
</code> string may be followed by
2615 a colon and zero or more comma-separated options. If any option is provided
2616 multiple times, the last occurrence wins.
</p>
2620 <p><em>key=
<key
></em>: only show trailers with specified
<key
>. Matching is done
2621 case-insensitively and trailing colon is optional. If option is
2622 given multiple times trailer lines matching any of the keys are
2623 shown. This option automatically enables the
<code>only
</code> option so that
2624 non-trailer lines in the trailer block are hidden. If that is not
2625 desired it can be disabled with
<code>only=false
</code>. E.g.,
2626 <code>%(trailers:key=Reviewed-by)
</code> shows trailer lines with key
2627 <code>Reviewed-by
</code>.
</p>
2630 <p><em>only[=
<bool
>]
</em>: select whether non-trailer lines from the trailer
2631 block should be included.
</p>
2634 <p><em>separator=
<sep
></em>: specify the separator inserted between trailer
2635 lines. Defaults to a line feed character. The string
<sep
> may contain
2636 the literal formatting codes described above. To use comma as
2637 separator one must use
<code>%x2C
</code> as it would otherwise be parsed as
2638 next option. E.g.,
<code>%(trailers:key=Ticket,separator=%x2C )
</code>
2639 shows all trailer lines whose key is
"Ticket" separated by a comma
2643 <p><em>unfold[=
<bool
>]
</em>: make it behave as if interpret-trailer
’s
<code>--unfold
</code>
2644 option was given. E.g.,
2645 <code>%(trailers:only,unfold=true)
</code> unfolds and shows all trailer lines.
</p>
2648 <p><em>keyonly[=
<bool
>]
</em>: only show the key part of the trailer.
</p>
2651 <p><em>valueonly[=
<bool
>]
</em>: only show the value part of the trailer.
</p>
2654 <p><em>key_value_separator=
<sep
></em>: specify the separator inserted between
2655 the key and value of each trailer. Defaults to
": ". Otherwise it
2656 shares the same semantics as
<em>separator=
<sep
></em> above.
</p>
2666 <div class=
"admonitionblock note">
2670 <div class=
"title">Note
</div>
2672 <td class=
"content">
2673 Some placeholders may depend on other options given to the
2674 revision traversal engine. For example, the
<code>%g*
</code> reflog options will
2675 insert an empty string unless we are traversing reflog entries (e.g., by
2676 <code>git log -g
</code>). The
<code>%d
</code> and
<code>%D
</code> placeholders will use the
"short"
2677 decoration format if
<code>--decorate
</code> was not already provided on the command
2683 <div class=
"paragraph">
2684 <p>The boolean options accept an optional value
<code>[=
<bool-value
>]
</code>. The values
2685 <code>true
</code>,
<code>false
</code>,
<code>on
</code>,
<code>off
</code> etc. are all accepted. See the
"boolean"
2686 sub-section in
"EXAMPLES" in
<a href=
"git-config.html">git-config(
1)
</a>. If a boolean
2687 option is given with no value, it
’s enabled.
</p>
2689 <div class=
"paragraph">
2690 <p>If you add a
<code>+
</code> (plus sign) after
<em>%
</em> of a placeholder, a line-feed
2691 is inserted immediately before the expansion if and only if the
2692 placeholder expands to a non-empty string.
</p>
2694 <div class=
"paragraph">
2695 <p>If you add a
<code>-
</code> (minus sign) after
<em>%
</em> of a placeholder, all consecutive
2696 line-feeds immediately preceding the expansion are deleted if and only if the
2697 placeholder expands to an empty string.
</p>
2699 <div class=
"paragraph">
2700 <p>If you add a ` ` (space) after
<em>%
</em> of a placeholder, a space
2701 is inserted immediately before the expansion if and only if the
2702 placeholder expands to a non-empty string.
</p>
2707 <p><em>tformat:
</em></p>
2708 <div class=
"paragraph">
2709 <p>The
<em>tformat:
</em> format works exactly like
<em>format:
</em>, except that it
2710 provides
"terminator" semantics instead of
"separator" semantics. In
2711 other words, each commit has the message terminator character (usually a
2712 newline) appended, rather than a separator placed between entries.
2713 This means that the final entry of a single-line format will be properly
2714 terminated with a new line, just as the
"oneline" format does.
2717 <div class=
"listingblock">
2718 <div class=
"content">
2719 <pre>$ git log -
2 --pretty=format:%h
4da45bef \
2720 | perl -pe '$_ .=
" -- NO NEWLINE\n" unless /\n/'
2722 7134973 -- NO NEWLINE
2724 $ git log -
2 --pretty=tformat:%h
4da45bef \
2725 | perl -pe '$_ .=
" -- NO NEWLINE\n" unless /\n/'
2730 <div class=
"paragraph">
2731 <p>In addition, any unrecognized string that has a
<code>%
</code> in it is interpreted
2732 as if it has
<code>tformat:
</code> in front of it. For example, these two are
2735 <div class=
"listingblock">
2736 <div class=
"content">
2737 <pre>$ git log -
2 --pretty=tformat:%h
4da45bef
2738 $ git log -
2 --pretty=%h
4da45bef
</pre>
2747 <h2 id=
"_diff_formatting">DIFF FORMATTING
</h2>
2748 <div class=
"sectionbody">
2749 <div class=
"paragraph">
2750 <p>By default,
<code>git log
</code> does not generate any diff output. The options
2751 below can be used to show the changes made by each commit.
</p>
2753 <div class=
"paragraph">
2754 <p>Note that unless one of
<code>--diff-merges
</code> variants (including short
2755 <code>-m
</code>,
<code>-c
</code>,
<code>--cc
</code>, and
<code>--dd
</code> options) is explicitly given, merge commits
2756 will not show a diff, even if a diff format like
<code>--patch
</code> is
2757 selected, nor will they match search options like
<code>-S
</code>. The exception
2758 is when
<code>--first-parent
</code> is in use, in which case
<code>first-parent
</code> is
2759 the default format for merge commits.
</p>
2763 <dt class=
"hdlist1">-p
</dt>
2764 <dt class=
"hdlist1">-u
</dt>
2765 <dt class=
"hdlist1">--patch
</dt>
2767 <p>Generate patch (see
<a href=
"#generate_patch_text_with_p">Generating patch text with -p
</a>).
</p>
2769 <dt class=
"hdlist1">-s
</dt>
2770 <dt class=
"hdlist1">--no-patch
</dt>
2772 <p>Suppress all output from the diff machinery. Useful for
2773 commands like
<code>git show
</code> that show the patch by default to
2774 squelch their output, or to cancel the effect of options like
2775 <code>--patch
</code>,
<code>--stat
</code> earlier on the command line in an alias.
</p>
2777 <dt class=
"hdlist1">-m
</dt>
2779 <p>Show diffs for merge commits in the default format. This is
2780 similar to
<em>--diff-merges=on
</em>, except
<code>-m
</code> will
2781 produce no output unless
<code>-p
</code> is given as well.
</p>
2783 <dt class=
"hdlist1">-c
</dt>
2785 <p>Produce combined diff output for merge commits.
2786 Shortcut for
<em>--diff-merges=combined -p
</em>.
</p>
2788 <dt class=
"hdlist1">--cc
</dt>
2790 <p>Produce dense combined diff output for merge commits.
2791 Shortcut for
<em>--diff-merges=dense-combined -p
</em>.
</p>
2793 <dt class=
"hdlist1">--dd
</dt>
2795 <p>Produce diff with respect to first parent for both merge and
2797 Shortcut for
<em>--diff-merges=first-parent -p
</em>.
</p>
2799 <dt class=
"hdlist1">--remerge-diff
</dt>
2801 <p>Produce remerge-diff output for merge commits.
2802 Shortcut for
<em>--diff-merges=remerge -p
</em>.
</p>
2804 <dt class=
"hdlist1">--no-diff-merges
</dt>
2806 <p>Synonym for
<em>--diff-merges=off
</em>.
</p>
2808 <dt class=
"hdlist1">--diff-merges=
<format
></dt>
2810 <p>Specify diff format to be used for merge commits. Default is
2811 `off` unless
<code>--first-parent
</code> is in use, in
2812 which case
<code>first-parent
</code> is the default.
</p>
2813 <div class=
"paragraph">
2814 <p>The following formats are supported:
</p>
2816 <div class=
"openblock">
2817 <div class=
"content">
2820 <dt class=
"hdlist1">off, none
</dt>
2822 <p>Disable output of diffs for merge commits. Useful to override
2825 <dt class=
"hdlist1">on, m
</dt>
2827 <p>Make diff output for merge commits to be shown in the default
2828 format. The default format can be changed using
2829 <code>log.diffMerges
</code> configuration variable, whose default value
2830 is
<code>separate
</code>.
</p>
2832 <dt class=
"hdlist1">first-parent,
1</dt>
2834 <p>Show full diff with respect to first parent. This is the same
2835 format as
<code>--patch
</code> produces for non-merge commits.
</p>
2837 <dt class=
"hdlist1">separate
</dt>
2839 <p>Show full diff with respect to each of parents.
2840 Separate log entry and diff is generated for each parent.
</p>
2842 <dt class=
"hdlist1">combined, c
</dt>
2844 <p>Show differences from each of the parents to the merge
2845 result simultaneously instead of showing pairwise diff between
2846 a parent and the result one at a time. Furthermore, it lists
2847 only files which were modified from all parents.
</p>
2849 <dt class=
"hdlist1">dense-combined, cc
</dt>
2851 <p>Further compress output produced by
<code>--diff-merges=combined
</code>
2852 by omitting uninteresting hunks whose contents in the parents
2853 have only two variants and the merge result picks one of them
2854 without modification.
</p>
2856 <dt class=
"hdlist1">remerge, r
</dt>
2858 <p>Remerge two-parent merge commits to create a temporary tree
2859 object
—​potentially containing files with conflict markers
2860 and such. A diff is then shown between that temporary tree
2861 and the actual merge commit.
</p>
2862 <div class=
"paragraph">
2863 <p>The output emitted when this option is used is subject to change, and
2864 so is its interaction with other options (unless explicitly
2873 <dt class=
"hdlist1">--combined-all-paths
</dt>
2875 <p>This flag causes combined diffs (used for merge commits) to
2876 list the name of the file from all parents. It thus only has
2877 effect when
<code>--diff-merges=[dense-]combined
</code> is in use, and
2878 is likely only useful if filename changes are detected (i.e.
2879 when either rename or copy detection have been requested).
</p>
2881 <dt class=
"hdlist1">-U
<n
></dt>
2882 <dt class=
"hdlist1">--unified=
<n
></dt>
2884 <p>Generate diffs with
<n
> lines of context instead of
2886 Implies
<code>--patch
</code>.
</p>
2888 <dt class=
"hdlist1">--output=
<file
></dt>
2890 <p>Output to a specific file instead of stdout.
</p>
2892 <dt class=
"hdlist1">--output-indicator-new=
<char
></dt>
2893 <dt class=
"hdlist1">--output-indicator-old=
<char
></dt>
2894 <dt class=
"hdlist1">--output-indicator-context=
<char
></dt>
2896 <p>Specify the character used to indicate new, old or context
2897 lines in the generated patch. Normally they are
<em>+
</em>,
<em>-
</em> and
2898 ' ' respectively.
</p>
2900 <dt class=
"hdlist1">--raw
</dt>
2902 <p>For each commit, show a summary of changes using the raw diff
2903 format. See the
"RAW OUTPUT FORMAT" section of
2904 <a href=
"git-diff.html">git-diff(
1)
</a>. This is different from showing the log
2905 itself in raw format, which you can achieve with
2906 <code>--format=raw
</code>.
</p>
2908 <dt class=
"hdlist1">--patch-with-raw
</dt>
2910 <p>Synonym for
<code>-p --raw
</code>.
</p>
2912 <dt class=
"hdlist1">-t
</dt>
2914 <p>Show the tree objects in the diff output.
</p>
2916 <dt class=
"hdlist1">--indent-heuristic
</dt>
2918 <p>Enable the heuristic that shifts diff hunk boundaries to make patches
2919 easier to read. This is the default.
</p>
2921 <dt class=
"hdlist1">--no-indent-heuristic
</dt>
2923 <p>Disable the indent heuristic.
</p>
2925 <dt class=
"hdlist1">--minimal
</dt>
2927 <p>Spend extra time to make sure the smallest possible
2928 diff is produced.
</p>
2930 <dt class=
"hdlist1">--patience
</dt>
2932 <p>Generate a diff using the
"patience diff" algorithm.
</p>
2934 <dt class=
"hdlist1">--histogram
</dt>
2936 <p>Generate a diff using the
"histogram diff" algorithm.
</p>
2938 <dt class=
"hdlist1">--anchored=
<text
></dt>
2940 <p>Generate a diff using the
"anchored diff" algorithm.
</p>
2941 <div class=
"paragraph">
2942 <p>This option may be specified more than once.
</p>
2944 <div class=
"paragraph">
2945 <p>If a line exists in both the source and destination, exists only once,
2946 and starts with this text, this algorithm attempts to prevent it from
2947 appearing as a deletion or addition in the output. It uses the
"patience
2948 diff" algorithm internally.
</p>
2951 <dt class=
"hdlist1">--diff-algorithm={patience|minimal|histogram|myers}
</dt>
2953 <p>Choose a diff algorithm. The variants are as follows:
</p>
2954 <div class=
"openblock">
2955 <div class=
"content">
2958 <dt class=
"hdlist1"><code>default
</code>,
<code>myers
</code></dt>
2960 <p>The basic greedy diff algorithm. Currently, this is the default.
</p>
2962 <dt class=
"hdlist1"><code>minimal
</code></dt>
2964 <p>Spend extra time to make sure the smallest possible diff is
2967 <dt class=
"hdlist1"><code>patience
</code></dt>
2969 <p>Use
"patience diff" algorithm when generating patches.
</p>
2971 <dt class=
"hdlist1"><code>histogram
</code></dt>
2973 <p>This algorithm extends the patience algorithm to
"support
2974 low-occurrence common elements".
</p>
2980 <div class=
"paragraph">
2981 <p>For instance, if you configured the
<code>diff.algorithm
</code> variable to a
2982 non-default value and want to use the default one, then you
2983 have to use
<code>--diff-algorithm=default
</code> option.
</p>
2986 <dt class=
"hdlist1">--stat[=
<width
>[,
<name-width
>[,
<count
>]]]
</dt>
2988 <p>Generate a diffstat. By default, as much space as necessary
2989 will be used for the filename part, and the rest for the graph
2990 part. Maximum width defaults to terminal width, or
80 columns
2991 if not connected to a terminal, and can be overridden by
2992 <code><width
></code>. The width of the filename part can be limited by
2993 giving another width
<code><name-width
></code> after a comma or by setting
2994 <code>diff.statNameWidth=
<width
></code>. The width of the graph part can be
2995 limited by using
<code>--stat-graph-width=
<width
></code> or by setting
2996 <code>diff.statGraphWidth=
<width
></code>. Using
<code>--stat
</code> or
2997 <code>--stat-graph-width
</code> affects all commands generating a stat graph,
2998 while setting
<code>diff.statNameWidth
</code> or
<code>diff.statGraphWidth
</code>
2999 does not affect
<code>git format-patch
</code>.
3000 By giving a third parameter
<code><count
></code>, you can limit the output to
3001 the first
<code><count
></code> lines, followed by
<code>...
</code> if there are more.
</p>
3002 <div class=
"paragraph">
3003 <p>These parameters can also be set individually with
<code>--stat-width=
<width
></code>,
3004 <code>--stat-name-width=
<name-width
></code> and
<code>--stat-count=
<count
></code>.
</p>
3007 <dt class=
"hdlist1">--compact-summary
</dt>
3009 <p>Output a condensed summary of extended header information such
3010 as file creations or deletions (
"new" or
"gone", optionally
"+l"
3011 if it
’s a symlink) and mode changes (
"+x" or
"-x" for adding
3012 or removing executable bit respectively) in diffstat. The
3013 information is put between the filename part and the graph
3014 part. Implies
<code>--stat
</code>.
</p>
3016 <dt class=
"hdlist1">--numstat
</dt>
3018 <p>Similar to
<code>--stat
</code>, but shows number of added and
3019 deleted lines in decimal notation and pathname without
3020 abbreviation, to make it more machine friendly. For
3021 binary files, outputs two
<code>-
</code> instead of saying
3022 <code>0 0</code>.
</p>
3024 <dt class=
"hdlist1">--shortstat
</dt>
3026 <p>Output only the last line of the
<code>--stat
</code> format containing total
3027 number of modified files, as well as number of added and deleted
3030 <dt class=
"hdlist1">-X[
<param1,param2,
…​>]
</dt>
3031 <dt class=
"hdlist1">--dirstat[=
<param1,param2,
…​>]
</dt>
3033 <p>Output the distribution of relative amount of changes for each
3034 sub-directory. The behavior of
<code>--dirstat
</code> can be customized by
3035 passing it a comma separated list of parameters.
3036 The defaults are controlled by the
<code>diff.dirstat
</code> configuration
3037 variable (see
<a href=
"git-config.html">git-config(
1)
</a>).
3038 The following parameters are available:
</p>
3039 <div class=
"openblock">
3040 <div class=
"content">
3043 <dt class=
"hdlist1"><code>changes
</code></dt>
3045 <p>Compute the dirstat numbers by counting the lines that have been
3046 removed from the source, or added to the destination. This ignores
3047 the amount of pure code movements within a file. In other words,
3048 rearranging lines in a file is not counted as much as other changes.
3049 This is the default behavior when no parameter is given.
</p>
3051 <dt class=
"hdlist1"><code>lines
</code></dt>
3053 <p>Compute the dirstat numbers by doing the regular line-based diff
3054 analysis, and summing the removed/added line counts. (For binary
3055 files, count
64-byte chunks instead, since binary files have no
3056 natural concept of lines). This is a more expensive
<code>--dirstat
</code>
3057 behavior than the
<code>changes
</code> behavior, but it does count rearranged
3058 lines within a file as much as other changes. The resulting output
3059 is consistent with what you get from the other
<code>--*stat
</code> options.
</p>
3061 <dt class=
"hdlist1"><code>files
</code></dt>
3063 <p>Compute the dirstat numbers by counting the number of files changed.
3064 Each changed file counts equally in the dirstat analysis. This is
3065 the computationally cheapest
<code>--dirstat
</code> behavior, since it does
3066 not have to look at the file contents at all.
</p>
3068 <dt class=
"hdlist1"><code>cumulative
</code></dt>
3070 <p>Count changes in a child directory for the parent directory as well.
3071 Note that when using
<code>cumulative
</code>, the sum of the percentages
3072 reported may exceed
100%. The default (non-cumulative) behavior can
3073 be specified with the
<code>noncumulative
</code> parameter.
</p>
3075 <dt class=
"hdlist1"><limit
></dt>
3077 <p>An integer parameter specifies a cut-off percent (
3% by default).
3078 Directories contributing less than this percentage of the changes
3079 are not shown in the output.
</p>
3085 <div class=
"paragraph">
3086 <p>Example: The following will count changed files, while ignoring
3087 directories with less than
10% of the total amount of changed files,
3088 and accumulating child directory counts in the parent directories:
3089 <code>--dirstat=files,
10,cumulative
</code>.
</p>
3092 <dt class=
"hdlist1">--cumulative
</dt>
3094 <p>Synonym for --dirstat=cumulative
</p>
3096 <dt class=
"hdlist1">--dirstat-by-file[=
<param1,param2
>…​]
</dt>
3098 <p>Synonym for --dirstat=files,
<param1
>,
<param2
>…​</p>
3100 <dt class=
"hdlist1">--summary
</dt>
3102 <p>Output a condensed summary of extended header information
3103 such as creations, renames and mode changes.
</p>
3105 <dt class=
"hdlist1">--patch-with-stat
</dt>
3107 <p>Synonym for
<code>-p --stat
</code>.
</p>
3109 <dt class=
"hdlist1">-z
</dt>
3111 <p>Separate the commits with NULs instead of newlines.
</p>
3112 <div class=
"paragraph">
3113 <p>Also, when
<code>--raw
</code> or
<code>--numstat
</code> has been given, do not munge
3114 pathnames and use NULs as output field terminators.
</p>
3116 <div class=
"paragraph">
3117 <p>Without this option, pathnames with
"unusual" characters are quoted as
3118 explained for the configuration variable
<code>core.quotePath
</code> (see
3119 <a href=
"git-config.html">git-config(
1)
</a>).
</p>
3122 <dt class=
"hdlist1">--name-only
</dt>
3124 <p>Show only the name of each changed file in the post-image tree.
3125 The file names are often encoded in UTF-
8.
3126 For more information see the discussion about encoding in the
<a href=
"git-log.html">git-log(
1)
</a>
3129 <dt class=
"hdlist1">--name-status
</dt>
3131 <p>Show only the name(s) and status of each changed file. See the description
3132 of the
<code>--diff-filter
</code> option on what the status letters mean.
3133 Just like
<code>--name-only
</code> the file names are often encoded in UTF-
8.
</p>
3135 <dt class=
"hdlist1">--submodule[=
<format
>]
</dt>
3137 <p>Specify how differences in submodules are shown. When specifying
3138 <code>--submodule=short
</code> the
<em>short
</em> format is used. This format just
3139 shows the names of the commits at the beginning and end of the range.
3140 When
<code>--submodule
</code> or
<code>--submodule=log
</code> is specified, the
<em>log
</em>
3141 format is used. This format lists the commits in the range like
3142 <a href=
"git-submodule.html">git-submodule(
1)
</a> <code>summary
</code> does. When
<code>--submodule=diff
</code>
3143 is specified, the
<em>diff
</em> format is used. This format shows an
3144 inline diff of the changes in the submodule contents between the
3145 commit range. Defaults to
<code>diff.submodule
</code> or the
<em>short
</em> format
3146 if the config option is unset.
</p>
3148 <dt class=
"hdlist1">--color[=
<when
>]
</dt>
3150 <p>Show colored diff.
3151 <code>--color
</code> (i.e. without
<em>=
<when
></em>) is the same as
<code>--color=always
</code>.
3152 <em><when
></em> can be one of
<code>always
</code>,
<code>never
</code>, or
<code>auto
</code>.
</p>
3154 <dt class=
"hdlist1">--no-color
</dt>
3156 <p>Turn off colored diff.
3157 It is the same as
<code>--color=never
</code>.
</p>
3159 <dt class=
"hdlist1">--color-moved[=
<mode
>]
</dt>
3161 <p>Moved lines of code are colored differently.
3162 The
<mode
> defaults to
<em>no
</em> if the option is not given
3163 and to
<em>zebra
</em> if the option with no mode is given.
3164 The mode must be one of:
</p>
3165 <div class=
"openblock">
3166 <div class=
"content">
3169 <dt class=
"hdlist1">no
</dt>
3171 <p>Moved lines are not highlighted.
</p>
3173 <dt class=
"hdlist1">default
</dt>
3175 <p>Is a synonym for
<code>zebra
</code>. This may change to a more sensible mode
3178 <dt class=
"hdlist1">plain
</dt>
3180 <p>Any line that is added in one location and was removed
3181 in another location will be colored with
<em>color.diff.newMoved
</em>.
3182 Similarly
<em>color.diff.oldMoved
</em> will be used for removed lines
3183 that are added somewhere else in the diff. This mode picks up any
3184 moved line, but it is not very useful in a review to determine
3185 if a block of code was moved without permutation.
</p>
3187 <dt class=
"hdlist1">blocks
</dt>
3189 <p>Blocks of moved text of at least
20 alphanumeric characters
3190 are detected greedily. The detected blocks are
3191 painted using either the
<em>color.diff.{old,new}Moved
</em> color.
3192 Adjacent blocks cannot be told apart.
</p>
3194 <dt class=
"hdlist1">zebra
</dt>
3196 <p>Blocks of moved text are detected as in
<em>blocks
</em> mode. The blocks
3197 are painted using either the
<em>color.diff.{old,new}Moved
</em> color or
3198 <em>color.diff.{old,new}MovedAlternative
</em>. The change between
3199 the two colors indicates that a new block was detected.
</p>
3201 <dt class=
"hdlist1">dimmed-zebra
</dt>
3203 <p>Similar to
<em>zebra
</em>, but additional dimming of uninteresting parts
3204 of moved code is performed. The bordering lines of two adjacent
3205 blocks are considered interesting, the rest is uninteresting.
3206 <code>dimmed_zebra
</code> is a deprecated synonym.
</p>
3213 <dt class=
"hdlist1">--no-color-moved
</dt>
3215 <p>Turn off move detection. This can be used to override configuration
3216 settings. It is the same as
<code>--color-moved=no
</code>.
</p>
3218 <dt class=
"hdlist1">--color-moved-ws=
<modes
></dt>
3220 <p>This configures how whitespace is ignored when performing the
3221 move detection for
<code>--color-moved
</code>.
3222 These modes can be given as a comma separated list:
</p>
3223 <div class=
"openblock">
3224 <div class=
"content">
3227 <dt class=
"hdlist1">no
</dt>
3229 <p>Do not ignore whitespace when performing move detection.
</p>
3231 <dt class=
"hdlist1">ignore-space-at-eol
</dt>
3233 <p>Ignore changes in whitespace at EOL.
</p>
3235 <dt class=
"hdlist1">ignore-space-change
</dt>
3237 <p>Ignore changes in amount of whitespace. This ignores whitespace
3238 at line end, and considers all other sequences of one or
3239 more whitespace characters to be equivalent.
</p>
3241 <dt class=
"hdlist1">ignore-all-space
</dt>
3243 <p>Ignore whitespace when comparing lines. This ignores differences
3244 even if one line has whitespace where the other line has none.
</p>
3246 <dt class=
"hdlist1">allow-indentation-change
</dt>
3248 <p>Initially ignore any whitespace in the move detection, then
3249 group the moved code blocks only into a block if the change in
3250 whitespace is the same per line. This is incompatible with the
3258 <dt class=
"hdlist1">--no-color-moved-ws
</dt>
3260 <p>Do not ignore whitespace when performing move detection. This can be
3261 used to override configuration settings. It is the same as
3262 <code>--color-moved-ws=no
</code>.
</p>
3264 <dt class=
"hdlist1">--word-diff[=
<mode
>]
</dt>
3266 <p>Show a word diff, using the
<mode
> to delimit changed words.
3267 By default, words are delimited by whitespace; see
3268 <code>--word-diff-regex
</code> below. The
<mode
> defaults to
<em>plain
</em>, and
3270 <div class=
"openblock">
3271 <div class=
"content">
3274 <dt class=
"hdlist1">color
</dt>
3276 <p>Highlight changed words using only colors. Implies
<code>--color
</code>.
</p>
3278 <dt class=
"hdlist1">plain
</dt>
3280 <p>Show words as
<code>[-removed-]
</code> and
<code>{+added+}
</code>. Makes no
3281 attempts to escape the delimiters if they appear in the input,
3282 so the output may be ambiguous.
</p>
3284 <dt class=
"hdlist1">porcelain
</dt>
3286 <p>Use a special line-based format intended for script
3287 consumption. Added/removed/unchanged runs are printed in the
3288 usual unified diff format, starting with a
<code>+
</code>/
<code>-
</code>/` `
3289 character at the beginning of the line and extending to the
3290 end of the line. Newlines in the input are represented by a
3291 tilde
<code>~
</code> on a line of its own.
</p>
3293 <dt class=
"hdlist1">none
</dt>
3295 <p>Disable word diff again.
</p>
3301 <div class=
"paragraph">
3302 <p>Note that despite the name of the first mode, color is used to
3303 highlight the changed parts in all modes if enabled.
</p>
3306 <dt class=
"hdlist1">--word-diff-regex=
<regex
></dt>
3308 <p>Use
<regex
> to decide what a word is, instead of considering
3309 runs of non-whitespace to be a word. Also implies
3310 <code>--word-diff
</code> unless it was already enabled.
</p>
3311 <div class=
"paragraph">
3312 <p>Every non-overlapping match of the
3313 <regex
> is considered a word. Anything between these matches is
3314 considered whitespace and ignored(!) for the purposes of finding
3315 differences. You may want to append
<code>|[^[:space:]]
</code> to your regular
3316 expression to make sure that it matches all non-whitespace characters.
3317 A match that contains a newline is silently truncated(!) at the
3320 <div class=
"paragraph">
3321 <p>For example,
<code>--word-diff-regex=.
</code> will treat each character as a word
3322 and, correspondingly, show differences character by character.
</p>
3324 <div class=
"paragraph">
3325 <p>The regex can also be set via a diff driver or configuration option, see
3326 <a href=
"gitattributes.html">gitattributes(
5)
</a> or
<a href=
"git-config.html">git-config(
1)
</a>. Giving it explicitly
3327 overrides any diff driver or configuration setting. Diff drivers
3328 override configuration settings.
</p>
3331 <dt class=
"hdlist1">--color-words[=
<regex
>]
</dt>
3333 <p>Equivalent to
<code>--word-diff=color
</code> plus (if a regex was
3334 specified)
<code>--word-diff-regex=
<regex
></code>.
</p>
3336 <dt class=
"hdlist1">--no-renames
</dt>
3338 <p>Turn off rename detection, even when the configuration
3339 file gives the default to do so.
</p>
3341 <dt class=
"hdlist1">--[no-]rename-empty
</dt>
3343 <p>Whether to use empty blobs as rename source.
</p>
3345 <dt class=
"hdlist1">--check
</dt>
3347 <p>Warn if changes introduce conflict markers or whitespace errors.
3348 What are considered whitespace errors is controlled by
<code>core.whitespace
</code>
3349 configuration. By default, trailing whitespaces (including
3350 lines that consist solely of whitespaces) and a space character
3351 that is immediately followed by a tab character inside the
3352 initial indent of the line are considered whitespace errors.
3353 Exits with non-zero status if problems are found. Not compatible
3354 with --exit-code.
</p>
3356 <dt class=
"hdlist1">--ws-error-highlight=
<kind
></dt>
3358 <p>Highlight whitespace errors in the
<code>context
</code>,
<code>old
</code> or
<code>new
</code>
3359 lines of the diff. Multiple values are separated by comma,
3360 <code>none
</code> resets previous values,
<code>default
</code> reset the list to
3361 <code>new
</code> and
<code>all
</code> is a shorthand for
<code>old,new,context
</code>. When
3362 this option is not given, and the configuration variable
3363 <code>diff.wsErrorHighlight
</code> is not set, only whitespace errors in
3364 <code>new
</code> lines are highlighted. The whitespace errors are colored
3365 with
<code>color.diff.whitespace
</code>.
</p>
3367 <dt class=
"hdlist1">--full-index
</dt>
3369 <p>Instead of the first handful of characters, show the full
3370 pre- and post-image blob object names on the
"index"
3371 line when generating patch format output.
</p>
3373 <dt class=
"hdlist1">--binary
</dt>
3375 <p>In addition to
<code>--full-index
</code>, output a binary diff that
3376 can be applied with
<code>git-apply
</code>.
3377 Implies
<code>--patch
</code>.
</p>
3379 <dt class=
"hdlist1">--abbrev[=
<n
>]
</dt>
3381 <p>Instead of showing the full
40-byte hexadecimal object
3382 name in diff-raw format output and diff-tree header
3383 lines, show the shortest prefix that is at least
<em><n
></em>
3384 hexdigits long that uniquely refers the object.
3385 In diff-patch output format,
<code>--full-index
</code> takes higher
3386 precedence, i.e. if
<code>--full-index
</code> is specified, full blob
3387 names will be shown regardless of
<code>--abbrev
</code>.
3388 Non default number of digits can be specified with
<code>--abbrev=
<n
></code>.
</p>
3390 <dt class=
"hdlist1">-B[
<n
>][/
<m
>]
</dt>
3391 <dt class=
"hdlist1">--break-rewrites[=[
<n
>][/
<m
>]]
</dt>
3393 <p>Break complete rewrite changes into pairs of delete and
3394 create. This serves two purposes:
</p>
3395 <div class=
"paragraph">
3396 <p>It affects the way a change that amounts to a total rewrite of a file
3397 not as a series of deletion and insertion mixed together with a very
3398 few lines that happen to match textually as the context, but as a
3399 single deletion of everything old followed by a single insertion of
3400 everything new, and the number
<code>m
</code> controls this aspect of the -B
3401 option (defaults to
60%).
<code>-B/
70%
</code> specifies that less than
30% of the
3402 original should remain in the result for Git to consider it a total
3403 rewrite (i.e. otherwise the resulting patch will be a series of
3404 deletion and insertion mixed together with context lines).
</p>
3406 <div class=
"paragraph">
3407 <p>When used with -M, a totally-rewritten file is also considered as the
3408 source of a rename (usually -M only considers a file that disappeared
3409 as the source of a rename), and the number
<code>n
</code> controls this aspect of
3410 the -B option (defaults to
50%).
<code>-B20%
</code> specifies that a change with
3411 addition and deletion compared to
20% or more of the file
’s size are
3412 eligible for being picked up as a possible source of a rename to
3416 <dt class=
"hdlist1">-M[
<n
>]
</dt>
3417 <dt class=
"hdlist1">--find-renames[=
<n
>]
</dt>
3419 <p>If generating diffs, detect and report renames for each commit.
3420 For following files across renames while traversing history, see
3421 <code>--follow
</code>.
3422 If
<code>n
</code> is specified, it is a threshold on the similarity
3423 index (i.e. amount of addition/deletions compared to the
3424 file
’s size). For example,
<code>-M90%
</code> means Git should consider a
3425 delete/add pair to be a rename if more than
90% of the file
3426 hasn
’t changed. Without a
<code>%
</code> sign, the number is to be read as
3427 a fraction, with a decimal point before it. I.e.,
<code>-M5
</code> becomes
3428 0.5, and is thus the same as
<code>-M50%
</code>. Similarly,
<code>-M05
</code> is
3429 the same as
<code>-M5%
</code>. To limit detection to exact renames, use
3430 <code>-M100%
</code>. The default similarity index is
50%.
</p>
3432 <dt class=
"hdlist1">-C[
<n
>]
</dt>
3433 <dt class=
"hdlist1">--find-copies[=
<n
>]
</dt>
3435 <p>Detect copies as well as renames. See also
<code>--find-copies-harder
</code>.
3436 If
<code>n
</code> is specified, it has the same meaning as for
<code>-M
<n
></code>.
</p>
3438 <dt class=
"hdlist1">--find-copies-harder
</dt>
3440 <p>For performance reasons, by default,
<code>-C
</code> option finds copies only
3441 if the original file of the copy was modified in the same
3442 changeset. This flag makes the command
3443 inspect unmodified files as candidates for the source of
3444 copy. This is a very expensive operation for large
3445 projects, so use it with caution. Giving more than one
3446 <code>-C
</code> option has the same effect.
</p>
3448 <dt class=
"hdlist1">-D
</dt>
3449 <dt class=
"hdlist1">--irreversible-delete
</dt>
3451 <p>Omit the preimage for deletes, i.e. print only the header but not
3452 the diff between the preimage and
<code>/dev/null
</code>. The resulting patch
3453 is not meant to be applied with
<code>patch
</code> or
<code>git apply
</code>; this is
3454 solely for people who want to just concentrate on reviewing the
3455 text after the change. In addition, the output obviously lacks
3456 enough information to apply such a patch in reverse, even manually,
3457 hence the name of the option.
</p>
3458 <div class=
"paragraph">
3459 <p>When used together with
<code>-B
</code>, omit also the preimage in the deletion part
3460 of a delete/create pair.
</p>
3463 <dt class=
"hdlist1">-l
<num
></dt>
3465 <p>The
<code>-M
</code> and
<code>-C
</code> options involve some preliminary steps that
3466 can detect subsets of renames/copies cheaply, followed by an
3467 exhaustive fallback portion that compares all remaining
3468 unpaired destinations to all relevant sources. (For renames,
3469 only remaining unpaired sources are relevant; for copies, all
3470 original sources are relevant.) For N sources and
3471 destinations, this exhaustive check is O(N^
2). This option
3472 prevents the exhaustive portion of rename/copy detection from
3473 running if the number of source/destination files involved
3474 exceeds the specified number. Defaults to diff.renameLimit.
3475 Note that a value of
0 is treated as unlimited.
</p>
3477 <dt class=
"hdlist1">--diff-filter=[(A|C|D|M|R|T|U|X|B)
…​[*]]
</dt>
3479 <p>Select only files that are Added (
<code>A
</code>), Copied (
<code>C
</code>),
3480 Deleted (
<code>D
</code>), Modified (
<code>M
</code>), Renamed (
<code>R
</code>), have their
3481 type (i.e. regular file, symlink, submodule,
…​) changed (
<code>T
</code>),
3482 are Unmerged (
<code>U
</code>), are
3483 Unknown (
<code>X
</code>), or have had their pairing Broken (
<code>B
</code>).
3484 Any combination of the filter characters (including none) can be used.
3485 When
<code>*
</code> (All-or-none) is added to the combination, all
3486 paths are selected if there is any file that matches
3487 other criteria in the comparison; if there is no file
3488 that matches other criteria, nothing is selected.
</p>
3489 <div class=
"paragraph">
3490 <p>Also, these upper-case letters can be downcased to exclude. E.g.
3491 <code>--diff-filter=ad
</code> excludes added and deleted paths.
</p>
3493 <div class=
"paragraph">
3494 <p>Note that not all diffs can feature all types. For instance, copied and
3495 renamed entries cannot appear if detection for those types is disabled.
</p>
3498 <dt class=
"hdlist1">-S
<string
></dt>
3500 <p>Look for differences that change the number of occurrences of
3501 the specified string (i.e. addition/deletion) in a file.
3502 Intended for the scripter
’s use.
</p>
3503 <div class=
"paragraph">
3504 <p>It is useful when you
’re looking for an exact block of code (like a
3505 struct), and want to know the history of that block since it first
3506 came into being: use the feature iteratively to feed the interesting
3507 block in the preimage back into
<code>-S
</code>, and keep going until you get the
3508 very first version of the block.
</p>
3510 <div class=
"paragraph">
3511 <p>Binary files are searched as well.
</p>
3514 <dt class=
"hdlist1">-G
<regex
></dt>
3516 <p>Look for differences whose patch text contains added/removed
3517 lines that match
<regex
>.
</p>
3518 <div class=
"paragraph">
3519 <p>To illustrate the difference between
<code>-S
<regex
> --pickaxe-regex
</code> and
3520 <code>-G
<regex
></code>, consider a commit with the following diff in the same
3523 <div class=
"listingblock">
3524 <div class=
"content">
3525 <pre>+ return frotz(nitfol, two-
>ptr,
1,
0);
3527 - hit = frotz(nitfol, mf2.ptr,
1,
0);
</pre>
3530 <div class=
"paragraph">
3531 <p>While
<code>git log -G
"frotz\(nitfol"</code> will show this commit,
<code>git log
3532 -S
"frotz\(nitfol" --pickaxe-regex
</code> will not (because the number of
3533 occurrences of that string did not change).
</p>
3535 <div class=
"paragraph">
3536 <p>Unless
<code>--text
</code> is supplied patches of binary files without a textconv
3537 filter will be ignored.
</p>
3539 <div class=
"paragraph">
3540 <p>See the
<em>pickaxe
</em> entry in
<a href=
"gitdiffcore.html">gitdiffcore(
7)
</a> for more
3544 <dt class=
"hdlist1">--find-object=
<object-id
></dt>
3546 <p>Look for differences that change the number of occurrences of
3547 the specified object. Similar to
<code>-S
</code>, just the argument is different
3548 in that it doesn
’t search for a specific string but for a specific
3550 <div class=
"paragraph">
3551 <p>The object can be a blob or a submodule commit. It implies the
<code>-t
</code> option in
3552 <code>git-log
</code> to also find trees.
</p>
3555 <dt class=
"hdlist1">--pickaxe-all
</dt>
3557 <p>When
<code>-S
</code> or
<code>-G
</code> finds a change, show all the changes in that
3558 changeset, not just the files that contain the change
3559 in
<string
>.
</p>
3561 <dt class=
"hdlist1">--pickaxe-regex
</dt>
3563 <p>Treat the
<string
> given to
<code>-S
</code> as an extended POSIX regular
3564 expression to match.
</p>
3566 <dt class=
"hdlist1">-O
<orderfile
></dt>
3568 <p>Control the order in which files appear in the output.
3569 This overrides the
<code>diff.orderFile
</code> configuration variable
3570 (see
<a href=
"git-config.html">git-config(
1)
</a>). To cancel
<code>diff.orderFile
</code>,
3571 use
<code>-O/dev/null
</code>.
</p>
3572 <div class=
"paragraph">
3573 <p>The output order is determined by the order of glob patterns in
3575 All files with pathnames that match the first pattern are output
3576 first, all files with pathnames that match the second pattern (but not
3577 the first) are output next, and so on.
3578 All files with pathnames that do not match any pattern are output
3579 last, as if there was an implicit match-all pattern at the end of the
3581 If multiple pathnames have the same rank (they match the same pattern
3582 but no earlier patterns), their output order relative to each other is
3583 the normal order.
</p>
3585 <div class=
"paragraph">
3586 <p><orderfile
> is parsed as follows:
</p>
3588 <div class=
"openblock">
3589 <div class=
"content">
3593 <p>Blank lines are ignored, so they can be used as separators for
3597 <p>Lines starting with a hash (
"<code>#</code>") are ignored, so they can be used
3598 for comments. Add a backslash (
"<code>\</code>") to the beginning of the
3599 pattern if it starts with a hash.
</p>
3602 <p>Each other line contains a single pattern.
</p>
3608 <div class=
"paragraph">
3609 <p>Patterns have the same syntax and semantics as patterns used for
3610 fnmatch(
3) without the FNM_PATHNAME flag, except a pathname also
3611 matches a pattern if removing any number of the final pathname
3612 components matches the pattern. For example, the pattern
"<code>foo*bar</code>"
3613 matches
"<code>fooasdfbar</code>" and
"<code>foo/bar/baz/asdf</code>" but not
"<code>foobarx</code>".
</p>
3616 <dt class=
"hdlist1">--skip-to=
<file
></dt>
3617 <dt class=
"hdlist1">--rotate-to=
<file
></dt>
3619 <p>Discard the files before the named
<file
> from the output
3620 (i.e.
<em>skip to
</em>), or move them to the end of the output
3621 (i.e.
<em>rotate to
</em>). These options were invented primarily for the use
3622 of the
<code>git difftool
</code> command, and may not be very useful
3625 <dt class=
"hdlist1">-R
</dt>
3627 <p>Swap two inputs; that is, show differences from index or
3628 on-disk file to tree contents.
</p>
3630 <dt class=
"hdlist1">--relative[=
<path
>]
</dt>
3631 <dt class=
"hdlist1">--no-relative
</dt>
3633 <p>When run from a subdirectory of the project, it can be
3634 told to exclude changes outside the directory and show
3635 pathnames relative to it with this option. When you are
3636 not in a subdirectory (e.g. in a bare repository), you
3637 can name which subdirectory to make the output relative
3638 to by giving a
<path
> as an argument.
3639 <code>--no-relative
</code> can be used to countermand both
<code>diff.relative
</code> config
3640 option and previous
<code>--relative
</code>.
</p>
3642 <dt class=
"hdlist1">-a
</dt>
3643 <dt class=
"hdlist1">--text
</dt>
3645 <p>Treat all files as text.
</p>
3647 <dt class=
"hdlist1">--ignore-cr-at-eol
</dt>
3649 <p>Ignore carriage-return at the end of line when doing a comparison.
</p>
3651 <dt class=
"hdlist1">--ignore-space-at-eol
</dt>
3653 <p>Ignore changes in whitespace at EOL.
</p>
3655 <dt class=
"hdlist1">-b
</dt>
3656 <dt class=
"hdlist1">--ignore-space-change
</dt>
3658 <p>Ignore changes in amount of whitespace. This ignores whitespace
3659 at line end, and considers all other sequences of one or
3660 more whitespace characters to be equivalent.
</p>
3662 <dt class=
"hdlist1">-w
</dt>
3663 <dt class=
"hdlist1">--ignore-all-space
</dt>
3665 <p>Ignore whitespace when comparing lines. This ignores
3666 differences even if one line has whitespace where the other
3669 <dt class=
"hdlist1">--ignore-blank-lines
</dt>
3671 <p>Ignore changes whose lines are all blank.
</p>
3673 <dt class=
"hdlist1">-I
<regex
></dt>
3674 <dt class=
"hdlist1">--ignore-matching-lines=
<regex
></dt>
3676 <p>Ignore changes whose all lines match
<regex
>. This option may
3677 be specified more than once.
</p>
3679 <dt class=
"hdlist1">--inter-hunk-context=
<lines
></dt>
3681 <p>Show the context between diff hunks, up to the specified number
3682 of lines, thereby fusing hunks that are close to each other.
3683 Defaults to
<code>diff.interHunkContext
</code> or
0 if the config option
3686 <dt class=
"hdlist1">-W
</dt>
3687 <dt class=
"hdlist1">--function-context
</dt>
3689 <p>Show whole function as context lines for each change.
3690 The function names are determined in the same way as
3691 <code>git diff
</code> works out patch hunk headers (see
<em>Defining a
3692 custom hunk-header
</em> in
<a href=
"gitattributes.html">gitattributes(
5)
</a>).
</p>
3694 <dt class=
"hdlist1">--ext-diff
</dt>
3696 <p>Allow an external diff helper to be executed. If you set an
3697 external diff driver with
<a href=
"gitattributes.html">gitattributes(
5)
</a>, you need
3698 to use this option with
<a href=
"git-log.html">git-log(
1)
</a> and friends.
</p>
3700 <dt class=
"hdlist1">--no-ext-diff
</dt>
3702 <p>Disallow external diff drivers.
</p>
3704 <dt class=
"hdlist1">--textconv
</dt>
3705 <dt class=
"hdlist1">--no-textconv
</dt>
3707 <p>Allow (or disallow) external text conversion filters to be run
3708 when comparing binary files. See
<a href=
"gitattributes.html">gitattributes(
5)
</a> for
3709 details. Because textconv filters are typically a one-way
3710 conversion, the resulting diff is suitable for human
3711 consumption, but cannot be applied. For this reason, textconv
3712 filters are enabled by default only for
<a href=
"git-diff.html">git-diff(
1)
</a> and
3713 <a href=
"git-log.html">git-log(
1)
</a>, but not for
<a href=
"git-format-patch.html">git-format-patch(
1)
</a> or
3714 diff plumbing commands.
</p>
3716 <dt class=
"hdlist1">--ignore-submodules[=
<when
>]
</dt>
3718 <p>Ignore changes to submodules in the diff generation.
<when
> can be
3719 either
"none",
"untracked",
"dirty" or
"all", which is the default.
3720 Using
"none" will consider the submodule modified when it either contains
3721 untracked or modified files or its HEAD differs from the commit recorded
3722 in the superproject and can be used to override any settings of the
3723 <em>ignore
</em> option in
<a href=
"git-config.html">git-config(
1)
</a> or
<a href=
"gitmodules.html">gitmodules(
5)
</a>. When
3724 "untracked" is used submodules are not considered dirty when they only
3725 contain untracked content (but they are still scanned for modified
3726 content). Using
"dirty" ignores all changes to the work tree of submodules,
3727 only changes to the commits stored in the superproject are shown (this was
3728 the behavior until
1.7.0). Using
"all" hides all changes to submodules.
</p>
3730 <dt class=
"hdlist1">--src-prefix=
<prefix
></dt>
3732 <p>Show the given source prefix instead of
"a/".
</p>
3734 <dt class=
"hdlist1">--dst-prefix=
<prefix
></dt>
3736 <p>Show the given destination prefix instead of
"b/".
</p>
3738 <dt class=
"hdlist1">--no-prefix
</dt>
3740 <p>Do not show any source or destination prefix.
</p>
3742 <dt class=
"hdlist1">--default-prefix
</dt>
3744 <p>Use the default source and destination prefixes (
"a/" and
"b/").
3745 This overrides configuration variables such as
<code>diff.noprefix
</code>,
3746 <code>diff.srcPrefix
</code>,
<code>diff.dstPrefix
</code>, and
<code>diff.mnemonicPrefix
</code>
3747 (see
<code>git-config
</code>(
1)).
</p>
3749 <dt class=
"hdlist1">--line-prefix=
<prefix
></dt>
3751 <p>Prepend an additional prefix to every line of output.
</p>
3753 <dt class=
"hdlist1">--ita-invisible-in-index
</dt>
3755 <p>By default entries added by
"git add -N" appear as an existing
3756 empty file in
"git diff" and a new file in
"git diff --cached".
3757 This option makes the entry appear as a new file in
"git diff"
3758 and non-existent in
"git diff --cached". This option could be
3759 reverted with
<code>--ita-visible-in-index
</code>. Both options are
3760 experimental and could be removed in future.
</p>
3764 <div class=
"paragraph">
3765 <p>For more detailed explanation on these common options, see also
3766 <a href=
"gitdiffcore.html">gitdiffcore(
7)
</a>.
</p>
3771 <h2 id=
"generate_patch_text_with_p">Generating patch text with -p
</h2>
3772 <div class=
"sectionbody">
3773 <div class=
"paragraph">
3775 <a href=
"git-diff.html">git-diff(
1)
</a>,
3776 <a href=
"git-log.html">git-log(
1)
</a>,
3777 <a href=
"git-show.html">git-show(
1)
</a>,
3778 <a href=
"git-diff-index.html">git-diff-index(
1)
</a>,
3779 <a href=
"git-diff-tree.html">git-diff-tree(
1)
</a>, or
3780 <a href=
"git-diff-files.html">git-diff-files(
1)
</a>
3781 with the
<code>-p
</code> option produces patch text.
3782 You can customize the creation of patch text via the
3783 <code>GIT_EXTERNAL_DIFF
</code> and the
<code>GIT_DIFF_OPTS
</code> environment variables
3784 (see
<a href=
"git.html">git(
1)
</a>), and the
<code>diff
</code> attribute (see
<a href=
"gitattributes.html">gitattributes(
5)
</a>).
</p>
3786 <div class=
"paragraph">
3787 <p>What the -p option produces is slightly different from the traditional
3790 <div class=
"olist arabic">
3793 <p>It is preceded by a
"git diff" header that looks like this:
</p>
3794 <div class=
"literalblock">
3795 <div class=
"content">
3796 <pre>diff --git a/file1 b/file2
</pre>
3799 <div class=
"paragraph">
3800 <p>The
<code>a/
</code> and
<code>b/
</code> filenames are the same unless rename/copy is
3801 involved. Especially, even for a creation or a deletion,
3802 <code>/dev/null
</code> is
<em>not
</em> used in place of the
<code>a/
</code> or
<code>b/
</code> filenames.
</p>
3804 <div class=
"paragraph">
3805 <p>When a rename/copy is involved,
<code>file1
</code> and
<code>file2
</code> show the
3806 name of the source file of the rename/copy and the name of
3807 the file that the rename/copy produces, respectively.
</p>
3811 <p>It is followed by one or more extended header lines:
</p>
3812 <div class=
"literalblock">
3813 <div class=
"content">
3814 <pre>old mode
<mode
>
3815 new mode
<mode
>
3816 deleted file mode
<mode
>
3817 new file mode
<mode
>
3818 copy from
<path
>
3819 copy to
<path
>
3820 rename from
<path
>
3821 rename to
<path
>
3822 similarity index
<number
>
3823 dissimilarity index
<number
>
3824 index
<hash
>..
<hash
> <mode
></pre>
3827 <div class=
"paragraph">
3828 <p>File modes are printed as
6-digit octal numbers including the file type
3829 and file permission bits.
</p>
3831 <div class=
"paragraph">
3832 <p>Path names in extended headers do not include the
<code>a/
</code> and
<code>b/
</code> prefixes.
</p>
3834 <div class=
"paragraph">
3835 <p>The similarity index is the percentage of unchanged lines, and
3836 the dissimilarity index is the percentage of changed lines. It
3837 is a rounded down integer, followed by a percent sign. The
3838 similarity index value of
100% is thus reserved for two equal
3839 files, while
100% dissimilarity means that no line from the old
3840 file made it into the new one.
</p>
3842 <div class=
"paragraph">
3843 <p>The index line includes the blob object names before and after the change.
3844 The
<mode
> is included if the file mode does not change; otherwise,
3845 separate lines indicate the old and the new mode.
</p>
3849 <p>Pathnames with
"unusual" characters are quoted as explained for
3850 the configuration variable
<code>core.quotePath
</code> (see
3851 <a href=
"git-config.html">git-config(
1)
</a>).
</p>
3854 <p>All the
<code>file1
</code> files in the output refer to files before the
3855 commit, and all the
<code>file2
</code> files refer to files after the commit.
3856 It is incorrect to apply each change to each file sequentially. For
3857 example, this patch will swap a and b:
</p>
3858 <div class=
"literalblock">
3859 <div class=
"content">
3860 <pre>diff --git a/a b/b
3870 <p>Hunk headers mention the name of the function to which the hunk
3871 applies. See
"Defining a custom hunk-header" in
3872 <a href=
"gitattributes.html">gitattributes(
5)
</a> for details of how to tailor this to
3873 specific languages.
</p>
3880 <h2 id=
"_combined_diff_format">Combined diff format
</h2>
3881 <div class=
"sectionbody">
3882 <div class=
"paragraph">
3883 <p>Any diff-generating command can take the
<code>-c
</code> or
<code>--cc
</code> option to
3884 produce a
<em>combined diff
</em> when showing a merge. This is the default
3885 format when showing merges with
<a href=
"git-diff.html">git-diff(
1)
</a> or
3886 <a href=
"git-show.html">git-show(
1)
</a>. Note also that you can give suitable
3887 <code>--diff-merges
</code> option to any of these commands to force generation of
3888 diffs in a specific format.
</p>
3890 <div class=
"paragraph">
3891 <p>A
"combined diff" format looks like this:
</p>
3893 <div class=
"listingblock">
3894 <div class=
"content">
3895 <pre>diff --combined describe.c
3896 index fabadb8,cc95eb0.
.4866510
3899 @@@ -
98,
20 -
98,
12 +
98,
20 @@@
3900 return (a_date
> b_date) ? -
1 : (a_date == b_date) ?
0 :
1;
3903 - static void describe(char *arg)
3904 -static void describe(struct commit *cmit, int last_one)
3905 ++static void describe(char *arg, int last_one)
3907 + unsigned char sha1[
20];
3908 + struct commit *cmit;
3909 struct commit_list *list;
3910 static int initialized =
0;
3911 struct commit_name *n;
3913 + if (get_sha1(arg, sha1)
< 0)
3914 + usage(describe_usage);
3915 + cmit = lookup_commit_reference(sha1);
3917 + usage(describe_usage);
3921 for_each_ref(get_name);
</pre>
3924 <div class=
"olist arabic">
3927 <p>It is preceded by a
"git diff" header, that looks like
3928 this (when the
<code>-c
</code> option is used):
</p>
3929 <div class=
"literalblock">
3930 <div class=
"content">
3931 <pre>diff --combined file
</pre>
3934 <div class=
"paragraph">
3935 <p>or like this (when the
<code>--cc
</code> option is used):
</p>
3937 <div class=
"literalblock">
3938 <div class=
"content">
3939 <pre>diff --cc file
</pre>
3944 <p>It is followed by one or more extended header lines
3945 (this example shows a merge with two parents):
</p>
3946 <div class=
"literalblock">
3947 <div class=
"content">
3948 <pre>index
<hash
>,
<hash
>..
<hash
>
3949 mode
<mode
>,
<mode
>..
<mode
>
3950 new file mode
<mode
>
3951 deleted file mode
<mode
>,
<mode
></pre>
3954 <div class=
"paragraph">
3955 <p>The
<code>mode
<mode
>,
<mode
>..
<mode
></code> line appears only if at least one of
3956 the
<mode
> is different from the rest. Extended headers with
3957 information about detected content movement (renames and
3958 copying detection) are designed to work with the diff of two
3959 <tree-ish
> and are not used by combined diff format.
</p>
3963 <p>It is followed by a two-line from-file/to-file header:
</p>
3964 <div class=
"literalblock">
3965 <div class=
"content">
3970 <div class=
"paragraph">
3971 <p>Similar to the two-line header for the traditional
<em>unified
</em> diff
3972 format,
<code>/dev/null
</code> is used to signal created or deleted
3975 <div class=
"paragraph">
3976 <p>However, if the --combined-all-paths option is provided, instead of a
3977 two-line from-file/to-file, you get an N+
1 line from-file/to-file header,
3978 where N is the number of parents in the merge commit:
</p>
3980 <div class=
"literalblock">
3981 <div class=
"content">
3988 <div class=
"paragraph">
3989 <p>This extended format can be useful if rename or copy detection is
3990 active, to allow you to see the original name of the file in different
3995 <p>Chunk header format is modified to prevent people from
3996 accidentally feeding it to
<code>patch -p1
</code>. Combined diff format
3997 was created for review of merge commit changes, and was not
3998 meant to be applied. The change is similar to the change in the
3999 extended
<em>index
</em> header:
</p>
4000 <div class=
"literalblock">
4001 <div class=
"content">
4002 <pre>@@@
<from-file-range
> <from-file-range
> <to-file-range
> @@@
</pre>
4005 <div class=
"paragraph">
4006 <p>There are (number of parents +
1)
<code>@
</code> characters in the chunk
4007 header for combined diff format.
</p>
4012 <div class=
"paragraph">
4013 <p>Unlike the traditional
<em>unified
</em> diff format, which shows two
4014 files A and B with a single column that has
<code>-
</code> (minus
 — appears in A but removed in B),
<code>+
</code> (plus
 — missing in A but
4015 added to B), or
<code>" "</code> (space
 — unchanged) prefix, this format
4016 compares two or more files file1, file2,
…​ with one file X, and
4017 shows how X differs from each of fileN. One column for each of
4018 fileN is prepended to the output line to note how X
’s line is
4019 different from it.
</p>
4021 <div class=
"paragraph">
4022 <p>A
<code>-
</code> character in the column N means that the line appears in
4023 fileN but it does not appear in the result. A
<code>+
</code> character
4024 in the column N means that the line appears in the result,
4025 and fileN does not have that line (in other words, the line was
4026 added, from the point of view of that parent).
</p>
4028 <div class=
"paragraph">
4029 <p>In the above example output, the function signature was changed
4030 from both files (hence two
<code>-
</code> removals from both file1 and
4031 file2, plus
<code>++
</code> to mean one line that was added does not appear
4032 in either file1 or file2). Also, eight other lines are the same
4033 from file1 but do not appear in file2 (hence prefixed with
<code>+
</code>).
</p>
4035 <div class=
"paragraph">
4036 <p>When shown by
<code>git diff-tree -c
</code>, it compares the parents of a
4037 merge commit with the merge result (i.e. file1..fileN are the
4038 parents). When shown by
<code>git diff-files -c
</code>, it compares the
4039 two unresolved merge parents with the working tree file
4040 (i.e. file1 is stage
2 aka
"our version", file2 is stage
3 aka
4041 "their version").
</p>
4046 <h2 id=
"_examples">EXAMPLES
</h2>
4047 <div class=
"sectionbody">
4050 <dt class=
"hdlist1"><code>git log --no-merges
</code></dt>
4052 <p>Show the whole commit history, but skip any merges
</p>
4054 <dt class=
"hdlist1"><code>git log v2.6
.12.. include/scsi drivers/scsi
</code></dt>
4056 <p>Show all commits since version
<em>v2.6
.12</em> that changed any file
4057 in the
<code>include/scsi
</code> or
<code>drivers/scsi
</code> subdirectories
</p>
4059 <dt class=
"hdlist1"><code>git log
--since=
"2 weeks ago" -- gitk
</code></dt>
4061 <p>Show the changes during the last two weeks to the file
<em>gitk
</em>.
4062 The
<code>--
</code> is necessary to avoid confusion with the
<strong>branch
</strong> named
4065 <dt class=
"hdlist1"><code>git log --name-status release..test
</code></dt>
4067 <p>Show the commits that are in the
"test" branch but not yet
4068 in the
"release" branch, along with the list of paths
4069 each commit modifies.
</p>
4071 <dt class=
"hdlist1"><code>git log --follow builtin/rev-list.c
</code></dt>
4073 <p>Shows the commits that changed
<code>builtin/rev-list.c
</code>, including
4074 those commits that occurred before the file was given its
4077 <dt class=
"hdlist1"><code>git log --branches --not --remotes=origin
</code></dt>
4079 <p>Shows all commits that are in any of local branches but not in
4080 any of remote-tracking branches for
<em>origin
</em> (what you have that
4081 origin doesn
’t).
</p>
4083 <dt class=
"hdlist1"><code>git log master --not --remotes=*/master
</code></dt>
4085 <p>Shows all commits that are in local master but not in any remote
4086 repository master branches.
</p>
4088 <dt class=
"hdlist1"><code>git log -p -m --first-parent
</code></dt>
4090 <p>Shows the history including change diffs, but only from the
4091 “main branch
” perspective, skipping commits that come from merged
4092 branches, and showing full diffs of changes introduced by the merges.
4093 This makes sense only when following a strict policy of merging all
4094 topic branches when staying on a single integration branch.
</p>
4096 <dt class=
"hdlist1"><code>git log -L '/int main/',/^}/:main.c
</code></dt>
4098 <p>Shows how the function
<code>main()
</code> in the file
<code>main.c
</code> evolved
4101 <dt class=
"hdlist1"><code>git log -
3</code></dt>
4103 <p>Limits the number of commits to show to
3.
</p>
4110 <h2 id=
"_discussion">DISCUSSION
</h2>
4111 <div class=
"sectionbody">
4112 <div class=
"paragraph">
4113 <p>Git is to some extent character encoding agnostic.
</p>
4118 <p>The contents of the blob objects are uninterpreted sequences
4119 of bytes. There is no encoding translation at the core
4123 <p>Path names are encoded in UTF-
8 normalization form C. This
4124 applies to tree objects, the index file, ref names, as well as
4125 path names in command line arguments, environment variables
4126 and config files (
<code>.git/config
</code> (see
<a href=
"git-config.html">git-config(
1)
</a>),
4127 <a href=
"gitignore.html">gitignore(
5)
</a>,
<a href=
"gitattributes.html">gitattributes(
5)
</a> and
4128 <a href=
"gitmodules.html">gitmodules(
5)
</a>).
</p>
4129 <div class=
"paragraph">
4130 <p>Note that Git at the core level treats path names simply as
4131 sequences of non-NUL bytes, there are no path name encoding
4132 conversions (except on Mac and Windows). Therefore, using
4133 non-ASCII path names will mostly work even on platforms and file
4134 systems that use legacy extended ASCII encodings. However,
4135 repositories created on such systems will not work properly on
4136 UTF-
8-based systems (e.g. Linux, Mac, Windows) and vice versa.
4137 Additionally, many Git-based tools simply assume path names to
4138 be UTF-
8 and will fail to display other encodings correctly.
</p>
4142 <p>Commit log messages are typically encoded in UTF-
8, but other
4143 extended ASCII encodings are also supported. This includes
4144 ISO-
8859-x, CP125x and many others, but
<em>not
</em> UTF-
16/
32,
4145 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
4146 EUC-x, CP9xx etc.).
</p>
4150 <div class=
"paragraph">
4151 <p>Although we encourage that the commit log messages are encoded
4152 in UTF-
8, both the core and Git Porcelain are designed not to
4153 force UTF-
8 on projects. If all participants of a particular
4154 project find it more convenient to use legacy encodings, Git
4155 does not forbid it. However, there are a few things to keep in
4158 <div class=
"olist arabic">
4161 <p><em>git commit
</em> and
<em>git commit-tree
</em> issue
4162 a warning if the commit log message given to it does not look
4163 like a valid UTF-
8 string, unless you explicitly say your
4164 project uses a legacy encoding. The way to say this is to
4165 have
<code>i18n.commitEncoding
</code> in
<code>.git/config
</code> file, like this:
</p>
4166 <div class=
"listingblock">
4167 <div class=
"content">
4169 commitEncoding = ISO-
8859-
1</pre>
4172 <div class=
"paragraph">
4173 <p>Commit objects created with the above setting record the value
4174 of
<code>i18n.commitEncoding
</code> in their
<code>encoding
</code> header. This is to
4175 help other people who look at them later. Lack of this header
4176 implies that the commit log message is encoded in UTF-
8.
</p>
4180 <p><em>git log
</em>,
<em>git show
</em>,
<em>git blame
</em> and friends look at the
4181 <code>encoding
</code> header of a commit object, and try to re-code the
4182 log message into UTF-
8 unless otherwise specified. You can
4183 specify the desired output encoding with
4184 <code>i18n.logOutputEncoding
</code> in
<code>.git/config
</code> file, like this:
</p>
4185 <div class=
"listingblock">
4186 <div class=
"content">
4188 logOutputEncoding = ISO-
8859-
1</pre>
4191 <div class=
"paragraph">
4192 <p>If you do not have this configuration variable, the value of
4193 <code>i18n.commitEncoding
</code> is used instead.
</p>
4198 <div class=
"paragraph">
4199 <p>Note that we deliberately chose not to re-code the commit log
4200 message when a commit is made to force UTF-
8 at the commit
4201 object level, because re-coding to UTF-
8 is not necessarily a
4202 reversible operation.
</p>
4207 <h2 id=
"_configuration">CONFIGURATION
</h2>
4208 <div class=
"sectionbody">
4209 <div class=
"paragraph">
4210 <p>See
<a href=
"git-config.html">git-config(
1)
</a> for core variables and
<a href=
"git-diff.html">git-diff(
1)
</a>
4211 for settings related to diff generation.
</p>
4215 <dt class=
"hdlist1">format.pretty
</dt>
4217 <p>Default for the
<code>--format
</code> option. (See
<em>Pretty Formats
</em> above.)
4218 Defaults to
<code>medium
</code>.
</p>
4220 <dt class=
"hdlist1">i18n.logOutputEncoding
</dt>
4222 <p>Encoding to use when displaying logs. (See
<em>Discussion
</em> above.)
4223 Defaults to the value of
<code>i18n.commitEncoding
</code> if set, and UTF-
8
4228 <div class=
"paragraph">
4229 <p>Everything above this line in this section isn
’t included from the
4230 <a href=
"git-config.html">git-config(
1)
</a> documentation. The content that follows is the
4231 same as what
’s found there:
</p>
4235 <dt class=
"hdlist1">log.abbrevCommit
</dt>
4237 <p>If true, makes
<a href=
"git-log.html">git-log(
1)
</a>,
<a href=
"git-show.html">git-show(
1)
</a>, and
4238 <a href=
"git-whatchanged.html">git-whatchanged(
1)
</a> assume
<code>--abbrev-commit
</code>. You may
4239 override this option with
<code>--no-abbrev-commit
</code>.
</p>
4241 <dt class=
"hdlist1">log.date
</dt>
4243 <p>Set the default date-time mode for the
<em>log
</em> command.
4244 Setting a value for log.date is similar to using
<em>git log
</em>'s
4245 <code>--date
</code> option. See
<a href=
"git-log.html">git-log(
1)
</a> for details.
</p>
4246 <div class=
"paragraph">
4247 <p>If the format is set to
"auto:foo" and the pager is in use, format
4248 "foo" will be used for the date format. Otherwise,
"default" will
4252 <dt class=
"hdlist1">log.decorate
</dt>
4254 <p>Print out the ref names of any commits that are shown by the log
4255 command. If
<em>short
</em> is specified, the ref name prefixes
<em>refs/heads/
</em>,
4256 <em>refs/tags/
</em> and
<em>refs/remotes/
</em> will not be printed. If
<em>full
</em> is
4257 specified, the full ref name (including prefix) will be printed.
4258 If
<em>auto
</em> is specified, then if the output is going to a terminal,
4259 the ref names are shown as if
<em>short
</em> were given, otherwise no ref
4260 names are shown. This is the same as the
<code>--decorate
</code> option
4261 of the
<code>git log
</code>.
</p>
4263 <dt class=
"hdlist1">log.initialDecorationSet
</dt>
4265 <p>By default,
<code>git log
</code> only shows decorations for certain known ref
4266 namespaces. If
<em>all
</em> is specified, then show all refs as
4269 <dt class=
"hdlist1">log.excludeDecoration
</dt>
4271 <p>Exclude the specified patterns from the log decorations. This is
4272 similar to the
<code>--decorate-refs-exclude
</code> command-line option, but
4273 the config option can be overridden by the
<code>--decorate-refs
</code>
4276 <dt class=
"hdlist1">log.diffMerges
</dt>
4278 <p>Set diff format to be used when
<code>--diff-merges=on
</code> is
4279 specified, see
<code>--diff-merges
</code> in
<a href=
"git-log.html">git-log(
1)
</a> for
4280 details. Defaults to
<code>separate
</code>.
</p>
4282 <dt class=
"hdlist1">log.follow
</dt>
4284 <p>If
<code>true
</code>,
<code>git log
</code> will act as if the
<code>--follow
</code> option was used when
4285 a single
<path
> is given. This has the same limitations as
<code>--follow
</code>,
4286 i.e. it cannot be used to follow multiple files and does not work well
4287 on non-linear history.
</p>
4289 <dt class=
"hdlist1">log.graphColors
</dt>
4291 <p>A list of colors, separated by commas, that can be used to draw
4292 history lines in
<code>git log --graph
</code>.
</p>
4294 <dt class=
"hdlist1">log.showRoot
</dt>
4296 <p>If true, the initial commit will be shown as a big creation event.
4297 This is equivalent to a diff against an empty tree.
4298 Tools like
<a href=
"git-log.html">git-log(
1)
</a> or
<a href=
"git-whatchanged.html">git-whatchanged(
1)
</a>, which
4299 normally hide the root commit will now show it. True by default.
</p>
4301 <dt class=
"hdlist1">log.showSignature
</dt>
4303 <p>If true, makes
<a href=
"git-log.html">git-log(
1)
</a>,
<a href=
"git-show.html">git-show(
1)
</a>, and
4304 <a href=
"git-whatchanged.html">git-whatchanged(
1)
</a> assume
<code>--show-signature
</code>.
</p>
4306 <dt class=
"hdlist1">log.mailmap
</dt>
4308 <p>If true, makes
<a href=
"git-log.html">git-log(
1)
</a>,
<a href=
"git-show.html">git-show(
1)
</a>, and
4309 <a href=
"git-whatchanged.html">git-whatchanged(
1)
</a> assume
<code>--use-mailmap
</code>, otherwise
4310 assume
<code>--no-use-mailmap
</code>. True by default.
</p>
4312 <dt class=
"hdlist1">notes.mergeStrategy
</dt>
4314 <p>Which merge strategy to choose by default when resolving notes
4315 conflicts. Must be one of
<code>manual
</code>,
<code>ours
</code>,
<code>theirs
</code>,
<code>union
</code>, or
4316 <code>cat_sort_uniq
</code>. Defaults to
<code>manual
</code>. See the
"NOTES MERGE STRATEGIES"
4317 section of
<a href=
"git-notes.html">git-notes(
1)
</a> for more information on each strategy.
</p>
4318 <div class=
"paragraph">
4319 <p>This setting can be overridden by passing the
<code>--strategy
</code> option to
4320 <a href=
"git-notes.html">git-notes(
1)
</a>.
</p>
4323 <dt class=
"hdlist1">notes.
<name
>.mergeStrategy
</dt>
4325 <p>Which merge strategy to choose when doing a notes merge into
4326 refs/notes/
<name
>. This overrides the more general
4327 "notes.mergeStrategy". See the
"NOTES MERGE STRATEGIES" section in
4328 <a href=
"git-notes.html">git-notes(
1)
</a> for more information on the available strategies.
</p>
4330 <dt class=
"hdlist1">notes.displayRef
</dt>
4332 <p>Which ref (or refs, if a glob or specified more than once), in
4333 addition to the default set by
<code>core.notesRef
</code> or
4334 <code>GIT_NOTES_REF
</code>, to read notes from when showing commit
4335 messages with the
<em>git log
</em> family of commands.
</p>
4336 <div class=
"paragraph">
4337 <p>This setting can be overridden with the
<code>GIT_NOTES_DISPLAY_REF
</code>
4338 environment variable, which must be a colon separated list of refs or
4341 <div class=
"paragraph">
4342 <p>A warning will be issued for refs that do not exist,
4343 but a glob that does not match any refs is silently ignored.
</p>
4345 <div class=
"paragraph">
4346 <p>This setting can be disabled by the
<code>--no-notes
</code> option to the
<em>git
4347 log
</em> family of commands, or by the
<code>--notes=
<ref
></code> option accepted by
4350 <div class=
"paragraph">
4351 <p>The effective value of
"core.notesRef" (possibly overridden by
4352 GIT_NOTES_REF) is also implicitly added to the list of refs to be
4356 <dt class=
"hdlist1">notes.rewrite.
<command
></dt>
4358 <p>When rewriting commits with
<command
> (currently
<code>amend
</code> or
4359 <code>rebase
</code>), if this variable is
<code>false
</code>, git will not copy
4360 notes from the original to the rewritten commit. Defaults to
4361 <code>true
</code>. See also
"<code>notes.rewriteRef</code>" below.
</p>
4362 <div class=
"paragraph">
4363 <p>This setting can be overridden with the
<code>GIT_NOTES_REWRITE_REF
</code>
4364 environment variable, which must be a colon separated list of refs or
4368 <dt class=
"hdlist1">notes.rewriteMode
</dt>
4370 <p>When copying notes during a rewrite (see the
4371 "notes.rewrite.<command>" option), determines what to do if
4372 the target commit already has a note. Must be one of
4373 <code>overwrite
</code>,
<code>concatenate
</code>,
<code>cat_sort_uniq
</code>, or
<code>ignore
</code>.
4374 Defaults to
<code>concatenate
</code>.
</p>
4375 <div class=
"paragraph">
4376 <p>This setting can be overridden with the
<code>GIT_NOTES_REWRITE_MODE
</code>
4377 environment variable.
</p>
4380 <dt class=
"hdlist1">notes.rewriteRef
</dt>
4382 <p>When copying notes during a rewrite, specifies the (fully
4383 qualified) ref whose notes should be copied. May be a glob,
4384 in which case notes in all matching refs will be copied. You
4385 may also specify this configuration several times.
</p>
4386 <div class=
"paragraph">
4387 <p>Does not have a default value; you must configure this variable to
4388 enable note rewriting. Set it to
<code>refs/notes/commits
</code> to enable
4389 rewriting for the default commit notes.
</p>
4391 <div class=
"paragraph">
4392 <p>Can be overridden with the
<code>GIT_NOTES_REWRITE_REF
</code> environment variable.
4393 See
<code>notes.rewrite.
<command
></code> above for a further description of its format.
</p>
4401 <h2 id=
"_git">GIT
</h2>
4402 <div class=
"sectionbody">
4403 <div class=
"paragraph">
4404 <p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p>
4410 <div id=
"footer-text">
4411 Last updated
2023-
10-
23 14:
43:
46 -
0700