blob: 2bc4cc93eec18c18ea66a8b691d1f095d70b7c76 [file] [log] [blame]
Junio C Hamano944ce252018-05-30 22:25:261<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano1d90cb02007-07-03 07:05:312<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano944ce252018-05-30 22:25:267<meta name="generator" content="AsciiDoc 8.6.10" />
Junio C Hamano103b5722011-01-31 05:03:458<title>git-stash(1)</title>
Junio C Hamano1d90cb02007-07-03 07:05:319<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1d90cb02007-07-03 07:05:3125}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
Junio C Hamanoba4b9282008-07-06 05:20:3131a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
Junio C Hamano1d90cb02007-07-03 07:05:3138
39em {
40 font-style: italic;
Junio C Hamano103b5722011-01-31 05:03:4541 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:3142}
43
44strong {
45 font-weight: bold;
Junio C Hamano103b5722011-01-31 05:03:4546 color: #083194;
Junio C Hamano1d90cb02007-07-03 07:05:3147}
48
Junio C Hamano1d90cb02007-07-03 07:05:3149h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:3151 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
Junio C Hamanoba4b9282008-07-06 05:20:3156h1, h2, h3 {
Junio C Hamano1d90cb02007-07-03 07:05:3157 border-bottom: 2px solid silver;
58}
59h2 {
Junio C Hamano1d90cb02007-07-03 07:05:3160 padding-top: 0.5em;
61}
Junio C Hamanoba4b9282008-07-06 05:20:3162h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamano1d90cb02007-07-03 07:05:3171
72div.sectionbody {
Junio C Hamano1d90cb02007-07-03 07:05:3173 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
Junio C Hamano103b5722011-01-31 05:03:4585ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano103b5722011-01-31 05:03:4590
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:3195 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamano1d90cb02007-07-03 07:05:31101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamano1d90cb02007-07-03 07:05:31103 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:31104 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31105 font-size: 1.1em;
Junio C Hamano1d90cb02007-07-03 07:05:31106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamano1d90cb02007-07-03 07:05:31108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamano1d90cb02007-07-03 07:05:31110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamano1d90cb02007-07-03 07:05:31113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamano1d90cb02007-07-03 07:05:31119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamano1d90cb02007-07-03 07:05:31123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamano103b5722011-01-31 05:03:45128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1d90cb02007-07-03 07:05:31132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22134 margin-top: 1.0em;
Junio C Hamano1d90cb02007-07-03 07:05:31135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
Junio C Hamano1d90cb02007-07-03 07:05:31142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
Junio C Hamano103b5722011-01-31 05:03:45150 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:31151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano1d90cb02007-07-03 07:05:31174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano1d90cb02007-07-03 07:05:31181 padding: 0.5em;
182}
183
Junio C Hamano7bd050f2011-09-22 06:32:22184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
Junio C Hamano103b5722011-01-31 05:03:45187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano1d90cb02007-07-03 07:05:31190}
Junio C Hamano7bd050f2011-09-22 06:32:22191
Junio C Hamano103b5722011-01-31 05:03:45192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
Junio C Hamano1d90cb02007-07-03 07:05:31194 text-align: right;
195}
Junio C Hamano103b5722011-01-31 05:03:45196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano103b5722011-01-31 05:03:45200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31206div.verseblock + div.attribution {
207 text-align: left;
208}
Junio C Hamano1d90cb02007-07-03 07:05:31209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22220 border-left: 3px solid #dddddd;
Junio C Hamano1d90cb02007-07-03 07:05:31221}
222
223div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
Junio C Hamano1d90cb02007-07-03 07:05:31226}
227
Junio C Hamano1d90cb02007-07-03 07:05:31228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano103b5722011-01-31 05:03:45230a.image:visited { color: white; }
Junio C Hamano1d90cb02007-07-03 07:05:31231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
Junio C Hamano103b5722011-01-31 05:03:45239 font-style: normal;
240 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:31241}
242dd > *:first-child {
Junio C Hamano103b5722011-01-31 05:03:45243 margin-top: 0.1em;
Junio C Hamano1d90cb02007-07-03 07:05:31244}
245
246ul, ol {
247 list-style-position: outside;
248}
Junio C Hamano103b5722011-01-31 05:03:45249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
Junio C Hamano1d90cb02007-07-03 07:05:31253 list-style-type: lower-alpha;
254}
Junio C Hamano103b5722011-01-31 05:03:45255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
Junio C Hamano1d90cb02007-07-03 07:05:31271
Junio C Hamano1d90cb02007-07-03 07:05:31272tfoot {
273 font-weight: bold;
274}
Junio C Hamano103b5722011-01-31 05:03:45275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano103b5722011-01-31 05:03:45278
279div.hdlist {
Junio C Hamano1d90cb02007-07-03 07:05:31280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
Junio C Hamano103b5722011-01-31 05:03:45283div.hdlist tr {
284 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31285}
Junio C Hamano103b5722011-01-31 05:03:45286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
Junio C Hamano1d90cb02007-07-03 07:05:31290 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45291 font-style: normal;
Junio C Hamano1d90cb02007-07-03 07:05:31292 padding-right: 0.8em;
Junio C Hamano103b5722011-01-31 05:03:45293 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:31294}
Junio C Hamano103b5722011-01-31 05:03:45295td.hdlist2 {
Junio C Hamano1d90cb02007-07-03 07:05:31296 vertical-align: top;
297}
Junio C Hamano103b5722011-01-31 05:03:45298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
Junio C Hamano1d90cb02007-07-03 07:05:31306
Junio C Hamano7bd050f2011-09-22 06:32:22307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano1d90cb02007-07-03 07:05:31341}
Junio C Hamanoba4b9282008-07-06 05:20:31342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31352 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9d971152012-12-19 00:43:11375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
439/* Because the table frame attribute is overriden by CSS in most browsers. */
440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano103b5722011-01-31 05:03:45522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage h2 {
Junio C Hamano103b5722011-01-31 05:03:45528 border-style: none;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano103b5722011-01-31 05:03:45532}
533
534@media print {
Junio C Hamano9d971152012-12-19 00:43:11535 body.manpage div#toc { display: none; }
Junio C Hamano103b5722011-01-31 05:03:45536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamano1d90cb02007-07-03 07:05:31539</style>
Junio C Hamano7bd050f2011-09-22 06:32:22540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9d971152012-12-19 00:43:11673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamano7bd050f2011-09-22 06:32:22683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9d971152012-12-19 00:43:11706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano1d90cb02007-07-03 07:05:31734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="manpage">
Junio C Hamano1d90cb02007-07-03 07:05:31736<div id="header">
737<h1>
738git-stash(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-stash -
743 Stash the changes in a dirty working directory away
744</p>
745</div>
746</div>
Junio C Hamano7bd050f2011-09-22 06:32:22747<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11748<div class="sect1">
Junio C Hamano103b5722011-01-31 05:03:45749<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31750<div class="sectionbody">
751<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11752<pre class="content"><em>git stash</em> list [&lt;options&gt;]
Junio C Hamanob5513772019-04-22 03:38:39753<em>git stash</em> show [&lt;options&gt;] [&lt;stash&gt;]
Junio C Hamano2c14c8d2009-07-02 03:17:00754<em>git stash</em> drop [-q|--quiet] [&lt;stash&gt;]
755<em>git stash</em> ( pop | apply ) [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano46a38aa2008-07-14 03:13:27756<em>git stash</em> branch &lt;branchname&gt; [&lt;stash&gt;]
Junio C Hamano53eec4d2017-03-10 23:02:36757<em>git stash</em> [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
Junio C Hamanoeeffc412018-03-28 19:41:54758 [-u|--include-untracked] [-a|--all] [-m|--message &lt;message&gt;]
Junio C Hamano53eec4d2017-03-10 23:02:36759 [--] [&lt;pathspec&gt;&#8230;]]
Junio C Hamano9e96a1a2008-08-16 10:23:18760<em>git stash</em> clear
Junio C Hamano50757392013-06-27 22:26:58761<em>git stash</em> create [&lt;message&gt;]
762<em>git stash</em> store [-m|--message &lt;message&gt;] [-q|--quiet] &lt;commit&gt;</pre>
Junio C Hamano9d971152012-12-19 00:43:11763<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45764</div></div>
Junio C Hamano1d90cb02007-07-03 07:05:31765</div>
Junio C Hamano9d971152012-12-19 00:43:11766</div>
767<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31768<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31769<div class="sectionbody">
Junio C Hamanoc14e6ad2014-10-31 20:25:53770<div class="paragraph"><p>Use <code>git stash</code> when you want to record the current state of the
Junio C Hamano1d90cb02007-07-03 07:05:31771working directory and the index, but want to go back to a clean
772working directory. The command saves your local modifications away
Junio C Hamanoc14e6ad2014-10-31 20:25:53773and reverts the working directory to match the <code>HEAD</code> commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45774<div class="paragraph"><p>The modifications stashed away by this command can be listed with
Junio C Hamanoc14e6ad2014-10-31 20:25:53775<code>git stash list</code>, inspected with <code>git stash show</code>, and restored
776(potentially on top of a different commit) with <code>git stash apply</code>.
Junio C Hamano3a9c0342017-11-10 06:01:12777Calling <code>git stash</code> without any arguments is equivalent to <code>git stash push</code>.
Junio C Hamanofce7c7e2008-07-02 03:06:38778A stash is by default listed as "WIP on <em>branchname</em> &#8230;", but
Junio C Hamanobb6e0782007-07-19 02:14:50779you can give a more descriptive message on the command line when
Junio C Hamanoba4b9282008-07-06 05:20:31780you create one.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53781<div class="paragraph"><p>The latest stash you created is stored in <code>refs/stash</code>; older
Junio C Hamano1d90cb02007-07-03 07:05:31782stashes are found in the reflog of this reference and can be named using
Junio C Hamanoc14e6ad2014-10-31 20:25:53783the usual reflog syntax (e.g. <code>stash@{0}</code> is the most recently
784created stash, <code>stash@{1}</code> is the one before it, <code>stash@{2.hours.ago}</code>
Junio C Hamanof2f28b12016-10-31 21:41:58785is also possible). Stashes may also be referenced by specifying just the
786stash index (e.g. the integer <code>n</code> is equivalent to <code>stash@{n}</code>).</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31787</div>
Junio C Hamano9d971152012-12-19 00:43:11788</div>
789<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31790<h2 id="_options">OPTIONS</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31791<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45792<div class="dlist"><dl>
793<dt class="hdlist1">
Junio C Hamano53eec4d2017-03-10 23:02:36794push [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message &lt;message&gt;] [--] [&lt;pathspec&gt;&#8230;]
795</dt>
Junio C Hamano1d90cb02007-07-03 07:05:31796<dd>
797<p>
Junio C Hamano967cda72017-06-30 21:49:53798 Save your local modifications to a new <em>stash entry</em> and roll them
Junio C Hamanoe89102f2017-02-15 23:18:15799 back to HEAD (in the working tree and in the index).
800 The &lt;message&gt; part is optional and gives
Junio C Hamano53eec4d2017-03-10 23:02:36801 the description along with the stashed state.
Junio C Hamano1d90cb02007-07-03 07:05:31802</p>
Junio C Hamano53eec4d2017-03-10 23:02:36803<div class="paragraph"><p>For quickly making a snapshot, you can omit "push". In this mode,
804non-option arguments are not allowed to prevent a misspelled
Junio C Hamano967cda72017-06-30 21:49:53805subcommand from making an unwanted stash entry. The two exceptions to this
Junio C Hamano53eec4d2017-03-10 23:02:36806are <code>stash -p</code> which acts as alias for <code>stash push -p</code> and pathspecs,
807which are allowed after a double hyphen <code>--</code> for disambiguation.</p></div>
Junio C Hamano967cda72017-06-30 21:49:53808<div class="paragraph"><p>When pathspec is given to <em>git stash push</em>, the new stash entry records the
Junio C Hamano53eec4d2017-03-10 23:02:36809modified states only for the files that match the pathspec. The index
810entries and working tree files are then rolled back to the state in
811HEAD only for these files, too, leaving files that do not match the
812pathspec intact.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53813<div class="paragraph"><p>If the <code>--keep-index</code> option is used, all changes already added to the
Junio C Hamano46a38aa2008-07-14 03:13:27814index are left intact.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53815<div class="paragraph"><p>If the <code>--include-untracked</code> option is used, all untracked files are also
816stashed and then cleaned up with <code>git clean</code>, leaving the working directory
817in a very clean state. If the <code>--all</code> option is used instead then the
Junio C Hamano15567bc2011-07-23 00:51:59818ignored files are stashed and cleaned in addition to the untracked files.</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53819<div class="paragraph"><p>With <code>--patch</code>, you can interactively select hunks from the diff
Junio C Hamanoc28068f2009-09-08 00:55:23820between HEAD and the working tree to be stashed. The stash entry is
821constructed such that its index state is the same as the index state
822of your repository, and its worktree contains only the changes you
823selected interactively. The selected changes are then rolled back
Junio C Hamano9d971152012-12-19 00:43:11824from your worktree. See the &#8220;Interactive Mode&#8221; section of
Junio C Hamanoc14e6ad2014-10-31 20:25:53825<a href="git-add.html">git-add(1)</a> to learn how to operate the <code>--patch</code> mode.</p></div>
826<div class="paragraph"><p>The <code>--patch</code> option implies <code>--keep-index</code>. You can use
827<code>--no-keep-index</code> to override this.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31828</dd>
Junio C Hamano103b5722011-01-31 05:03:45829<dt class="hdlist1">
Junio C Hamano3a9c0342017-11-10 06:01:12830save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [&lt;message&gt;]
831</dt>
832<dd>
833<p>
834 This option is deprecated in favour of <em>git stash push</em>. It
835 differs from "stash push" in that it cannot take pathspecs,
836 and any non-option arguments form the message.
837</p>
838</dd>
839<dt class="hdlist1">
Junio C Hamano83d46a22008-02-21 02:29:42840list [&lt;options&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31841</dt>
842<dd>
843<p>
Junio C Hamano967cda72017-06-30 21:49:53844 List the stash entries that you currently have. Each <em>stash entry</em> is
845 listed with its name (e.g. <code>stash@{0}</code> is the latest entry, <code>stash@{1}</code> is
Junio C Hamano1d90cb02007-07-03 07:05:31846 the one before, etc.), the name of the branch that was current when the
Junio C Hamano967cda72017-06-30 21:49:53847 entry was made, and a short description of the commit the entry was
Junio C Hamano1d90cb02007-07-03 07:05:31848 based on.
849</p>
850<div class="listingblock">
851<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53852<pre><code>stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation
853stash@{1}: On master: 9cc0589... Add git-stash</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31854</div></div>
Junio C Hamano103b5722011-01-31 05:03:45855<div class="paragraph"><p>The command takes options applicable to the <em>git log</em>
Junio C Hamanoa28a9202012-06-21 07:08:23856command to control what is shown and how. See <a href="git-log.html">git-log(1)</a>.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31857</dd>
Junio C Hamano103b5722011-01-31 05:03:45858<dt class="hdlist1">
Junio C Hamanob5513772019-04-22 03:38:39859show [&lt;options&gt;] [&lt;stash&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31860</dt>
861<dd>
862<p>
Junio C Hamano967cda72017-06-30 21:49:53863 Show the changes recorded in the stash entry as a diff between the
864 stashed contents and the commit back when the stash entry was first
865 created. When no <code>&lt;stash&gt;</code> is given, it shows the latest one.
866 By default, the command shows the diffstat, but it will accept any
867 format known to <em>git diff</em> (e.g., <code>git stash show -p stash@{1}</code>
868 to view the second most recent entry in patch form).
Junio C Hamano1eb56092015-10-05 20:39:53869 You can use stash.showStat and/or stash.showPatch config variables
870 to change the default behavior.
Junio C Hamano1d90cb02007-07-03 07:05:31871</p>
872</dd>
Junio C Hamano103b5722011-01-31 05:03:45873<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00874pop [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano7d3275e2009-05-31 21:53:30875</dt>
876<dd>
877<p>
878 Remove a single stashed state from the stash list and apply it
879 on top of the current working tree state, i.e., do the inverse
Junio C Hamano3a9c0342017-11-10 06:01:12880 operation of <code>git stash push</code>. The working directory must
Junio C Hamano7d3275e2009-05-31 21:53:30881 match the index.
882</p>
Junio C Hamano103b5722011-01-31 05:03:45883<div class="paragraph"><p>Applying the state can fail with conflicts; in this case, it is not
Junio C Hamano7d3275e2009-05-31 21:53:30884removed from the stash list. You need to resolve the conflicts by hand
Junio C Hamanoc14e6ad2014-10-31 20:25:53885and call <code>git stash drop</code> manually afterwards.</p></div>
886<div class="paragraph"><p>If the <code>--index</code> option is used, then tries to reinstate not only the working
Junio C Hamano103b5722011-01-31 05:03:45887tree&#8217;s changes, but also the index&#8217;s ones. However, this can fail, when you
Junio C Hamanof068d542009-06-09 15:46:41888have conflicts (which are stored in the index, where you therefore can no
889longer apply the changes as they were originally).</p></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53890<div class="paragraph"><p>When no <code>&lt;stash&gt;</code> is given, <code>stash@{0}</code> is assumed, otherwise <code>&lt;stash&gt;</code> must
891be a reference of the form <code>stash@{&lt;revision&gt;}</code>.</p></div>
Junio C Hamano7d3275e2009-05-31 21:53:30892</dd>
Junio C Hamano103b5722011-01-31 05:03:45893<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00894apply [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31895</dt>
896<dd>
897<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53898 Like <code>pop</code>, but do not remove the state from the stash list. Unlike <code>pop</code>,
899 <code>&lt;stash&gt;</code> may be any commit that looks like a commit created by
Junio C Hamano3a9c0342017-11-10 06:01:12900 <code>stash push</code> or <code>stash create</code>.
Junio C Hamano1d90cb02007-07-03 07:05:31901</p>
Junio C Hamano1d90cb02007-07-03 07:05:31902</dd>
Junio C Hamano103b5722011-01-31 05:03:45903<dt class="hdlist1">
Junio C Hamano46a38aa2008-07-14 03:13:27904branch &lt;branchname&gt; [&lt;stash&gt;]
905</dt>
906<dd>
907<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53908 Creates and checks out a new branch named <code>&lt;branchname&gt;</code> starting from
909 the commit at which the <code>&lt;stash&gt;</code> was originally created, applies the
910 changes recorded in <code>&lt;stash&gt;</code> to the new working tree and index.
911 If that succeeds, and <code>&lt;stash&gt;</code> is a reference of the form
912 <code>stash@{&lt;revision&gt;}</code>, it then drops the <code>&lt;stash&gt;</code>. When no <code>&lt;stash&gt;</code>
Junio C Hamano46a38aa2008-07-14 03:13:27913 is given, applies the latest one.
914</p>
Junio C Hamano3a9c0342017-11-10 06:01:12915<div class="paragraph"><p>This is useful if the branch on which you ran <code>git stash push</code> has
Junio C Hamanoc14e6ad2014-10-31 20:25:53916changed enough that <code>git stash apply</code> fails due to conflicts. Since
Junio C Hamano967cda72017-06-30 21:49:53917the stash entry is applied on top of the commit that was HEAD at the
918time <code>git stash</code> was run, it restores the originally stashed state
919with no conflicts.</p></div>
Junio C Hamano46a38aa2008-07-14 03:13:27920</dd>
Junio C Hamano103b5722011-01-31 05:03:45921<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31922clear
923</dt>
924<dd>
925<p>
Junio C Hamano967cda72017-06-30 21:49:53926 Remove all the stash entries. Note that those entries will then
Junio C Hamano9f883862009-08-11 06:23:52927 be subject to pruning, and may be impossible to recover (see
928 <em>Examples</em> below for a possible strategy).
Junio C Hamano1d90cb02007-07-03 07:05:31929</p>
930</dd>
Junio C Hamano103b5722011-01-31 05:03:45931<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00932drop [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano86bcccc2008-03-08 09:33:55933</dt>
934<dd>
935<p>
Junio C Hamano967cda72017-06-30 21:49:53936 Remove a single stash entry from the list of stash entries.
937 When no <code>&lt;stash&gt;</code> is given, it removes the latest one.
938 i.e. <code>stash@{0}</code>, otherwise <code>&lt;stash&gt;</code> must be a valid stash
939 log reference of the form <code>stash@{&lt;revision&gt;}</code>.
Junio C Hamano86bcccc2008-03-08 09:33:55940</p>
941</dd>
Junio C Hamano103b5722011-01-31 05:03:45942<dt class="hdlist1">
Junio C Hamano9e96a1a2008-08-16 10:23:18943create
944</dt>
945<dd>
946<p>
Junio C Hamano967cda72017-06-30 21:49:53947 Create a stash entry (which is a regular commit object) and
948 return its object name, without storing it anywhere in the ref
949 namespace.
Junio C Hamano50757392013-06-27 22:26:58950 This is intended to be useful for scripts. It is probably not
Junio C Hamano912712b2017-12-06 18:04:01951 the command you want to use; see "push" above.
Junio C Hamano50757392013-06-27 22:26:58952</p>
953</dd>
954<dt class="hdlist1">
955store
956</dt>
957<dd>
958<p>
959 Store a given stash created via <em>git stash create</em> (which is a
960 dangling merge commit) in the stash ref, updating the stash
961 reflog. This is intended to be useful for scripts. It is
Junio C Hamano912712b2017-12-06 18:04:01962 probably not the command you want to use; see "push" above.
Junio C Hamano9e96a1a2008-08-16 10:23:18963</p>
964</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31965</dl></div>
Junio C Hamano1d90cb02007-07-03 07:05:31966</div>
Junio C Hamano9d971152012-12-19 00:43:11967</div>
968<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31969<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31970<div class="sectionbody">
Junio C Hamano967cda72017-06-30 21:49:53971<div class="paragraph"><p>A stash entry is represented as a commit whose tree records the state
972of the working directory, and its first parent is the commit at <code>HEAD</code>
973when the entry was created. The tree of the second parent records the
974state of the index when the entry is made, and it is made a child of
Junio C Hamanoc14e6ad2014-10-31 20:25:53975the <code>HEAD</code> commit. The ancestry graph looks like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31976<div class="literalblock">
977<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53978<pre><code> .----W
Junio C Hamano1d90cb02007-07-03 07:05:31979 / /
Junio C Hamanoc14e6ad2014-10-31 20:25:53980-----H----I</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31981</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53982<div class="paragraph"><p>where <code>H</code> is the <code>HEAD</code> commit, <code>I</code> is a commit that records the state
983of the index, and <code>W</code> is a commit that records the state of the working
Junio C Hamanoba4b9282008-07-06 05:20:31984tree.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31985</div>
Junio C Hamano9d971152012-12-19 00:43:11986</div>
987<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31988<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31989<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45990<div class="dlist"><dl>
991<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31992Pulling into a dirty tree
993</dt>
994<dd>
995<p>
996When you are in the middle of something, you learn that there are
997upstream changes that are possibly relevant to what you are
998doing. When your local changes do not conflict with the changes in
Junio C Hamanoc14e6ad2014-10-31 20:25:53999the upstream, a simple <code>git pull</code> will let you move forward.
Junio C Hamano1d90cb02007-07-03 07:05:311000</p>
Junio C Hamano103b5722011-01-31 05:03:451001<div class="paragraph"><p>However, there are cases in which your local changes do conflict with
Junio C Hamanoc14e6ad2014-10-31 20:25:531002the upstream changes, and <code>git pull</code> refuses to overwrite your
Junio C Hamano1d90cb02007-07-03 07:05:311003changes. In such a case, you can stash your changes away,
Junio C Hamanoba4b9282008-07-06 05:20:311004perform a pull, and then unstash, like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311005<div class="listingblock">
1006<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531007<pre><code>$ git pull
Junio C Hamanoa2f46622008-09-03 05:20:311008 ...
Junio C Hamano1d90cb02007-07-03 07:05:311009file foobar not up to date, cannot merge.
1010$ git stash
1011$ git pull
Junio C Hamanoc14e6ad2014-10-31 20:25:531012$ git stash pop</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311013</div></div>
1014</dd>
Junio C Hamano103b5722011-01-31 05:03:451015<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:311016Interrupted workflow
1017</dt>
1018<dd>
1019<p>
1020When you are in the middle of something, your boss comes in and
1021demands that you fix something immediately. Traditionally, you would
1022make a commit to a temporary branch to store your changes away, and
1023return to your original branch to make the emergency fix, like this:
1024</p>
1025<div class="listingblock">
1026<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531027<pre><code># ... hack hack hack ...
Junio C Hamanoc9f11c22019-07-10 02:54:041028$ git switch -c my_wip
Junio C Hamano1d90cb02007-07-03 07:05:311029$ git commit -a -m "WIP"
Junio C Hamanoc9f11c22019-07-10 02:54:041030$ git switch master
Junio C Hamano1d90cb02007-07-03 07:05:311031$ edit emergency fix
1032$ git commit -a -m "Fix in a hurry"
Junio C Hamanoc9f11c22019-07-10 02:54:041033$ git switch my_wip
Junio C Hamano1d90cb02007-07-03 07:05:311034$ git reset --soft HEAD^
Junio C Hamanoc14e6ad2014-10-31 20:25:531035# ... continue hacking ...</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311036</div></div>
Junio C Hamano103b5722011-01-31 05:03:451037<div class="paragraph"><p>You can use <em>git stash</em> to simplify the above, like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311038<div class="listingblock">
1039<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531040<pre><code># ... hack hack hack ...
Junio C Hamano1d90cb02007-07-03 07:05:311041$ git stash
1042$ edit emergency fix
1043$ git commit -a -m "Fix in a hurry"
Junio C Hamano7d3275e2009-05-31 21:53:301044$ git stash pop
Junio C Hamanoc14e6ad2014-10-31 20:25:531045# ... continue hacking ...</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311046</div></div>
1047</dd>
Junio C Hamano103b5722011-01-31 05:03:451048<dt class="hdlist1">
Junio C Hamano46a38aa2008-07-14 03:13:271049Testing partial commits
1050</dt>
1051<dd>
1052<p>
Junio C Hamano3a9c0342017-11-10 06:01:121053You can use <code>git stash push --keep-index</code> when you want to make two or
Junio C Hamano46a38aa2008-07-14 03:13:271054more commits out of the changes in the work tree, and you want to test
1055each change before committing:
1056</p>
1057<div class="listingblock">
1058<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531059<pre><code># ... hack hack hack ...
Junio C Hamano46a38aa2008-07-14 03:13:271060$ git add --patch foo # add just first part to the index
Junio C Hamano3a9c0342017-11-10 06:01:121061$ git stash push --keep-index # save all other changes to the stash
Junio C Hamano46a38aa2008-07-14 03:13:271062$ edit/build/test first part
Junio C Hamanoa2f46622008-09-03 05:20:311063$ git commit -m 'First part' # commit fully tested change
Junio C Hamano46a38aa2008-07-14 03:13:271064$ git stash pop # prepare to work on all other changes
Junio C Hamanoa2f46622008-09-03 05:20:311065# ... repeat above five steps until one commit remains ...
Junio C Hamano46a38aa2008-07-14 03:13:271066$ edit/build/test remaining parts
Junio C Hamanoc14e6ad2014-10-31 20:25:531067$ git commit foo -m 'Remaining parts'</code></pre>
Junio C Hamano46a38aa2008-07-14 03:13:271068</div></div>
1069</dd>
Junio C Hamano103b5722011-01-31 05:03:451070<dt class="hdlist1">
Junio C Hamano967cda72017-06-30 21:49:531071Recovering stash entries that were cleared/dropped erroneously
Junio C Hamano9f883862009-08-11 06:23:521072</dt>
1073<dd>
1074<p>
Junio C Hamano967cda72017-06-30 21:49:531075If you mistakenly drop or clear stash entries, they cannot be recovered
Junio C Hamano9f883862009-08-11 06:23:521076through the normal safety mechanisms. However, you can try the
Junio C Hamano967cda72017-06-30 21:49:531077following incantation to get a list of stash entries that are still in
1078your repository, but not reachable any more:
Junio C Hamano9f883862009-08-11 06:23:521079</p>
1080<div class="listingblock">
1081<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531082<pre><code>git fsck --unreachable |
Junio C Hamano9f883862009-08-11 06:23:521083grep commit | cut -d\ -f3 |
Junio C Hamanoc14e6ad2014-10-31 20:25:531084xargs git log --merges --no-walk --grep=WIP</code></pre>
Junio C Hamano9f883862009-08-11 06:23:521085</div></div>
1086</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311087</dl></div>
Junio C Hamano1d90cb02007-07-03 07:05:311088</div>
Junio C Hamano9d971152012-12-19 00:43:111089</div>
1090<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311091<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1d90cb02007-07-03 07:05:311092<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231093<div class="paragraph"><p><a href="git-checkout.html">git-checkout(1)</a>,
1094<a href="git-commit.html">git-commit(1)</a>,
1095<a href="git-reflog.html">git-reflog(1)</a>,
Junio C Hamanoc9f11c22019-07-10 02:54:041096<a href="git-reset.html">git-reset(1)</a>,
1097<a href="git-switch.html">git-switch(1)</a></p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311098</div>
Junio C Hamano9d971152012-12-19 00:43:111099</div>
1100<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311101<h2 id="_git">GIT</h2>
Junio C Hamano1d90cb02007-07-03 07:05:311102<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231103<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311104</div>
Junio C Hamano7bd050f2011-09-22 06:32:221105</div>
Junio C Hamano9d971152012-12-19 00:43:111106</div>
Junio C Hamano7bd050f2011-09-22 06:32:221107<div id="footnotes"><hr /></div>
Junio C Hamano1d90cb02007-07-03 07:05:311108<div id="footer">
1109<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531110Last updated
Junio C Hamanoc9f11c22019-07-10 02:54:041111 2019-07-09 19:51:04 PDT
Junio C Hamano1d90cb02007-07-03 07:05:311112</div>
1113</div>
1114</body>
1115</html>