blob: 1ce41a2c8f1e73a52fe52608ea872cdd00cdd5c9 [file] [log] [blame]
Junio C Hamano1d90cb02007-07-03 07:05:311<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
Junio C Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano103b5722011-01-31 05:03:457<title>git-stash(1)</title>
Junio C Hamano1d90cb02007-07-03 07:05:318<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1d90cb02007-07-03 07:05:3124}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1d90cb02007-07-03 07:05:3137
38em {
39 font-style: italic;
Junio C Hamano103b5722011-01-31 05:03:4540 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:3141}
42
43strong {
44 font-weight: bold;
Junio C Hamano103b5722011-01-31 05:03:4545 color: #083194;
Junio C Hamano1d90cb02007-07-03 07:05:3146}
47
Junio C Hamano1d90cb02007-07-03 07:05:3148h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:3150 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1d90cb02007-07-03 07:05:3156 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1d90cb02007-07-03 07:05:3159 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1d90cb02007-07-03 07:05:3170
71div.sectionbody {
Junio C Hamano1d90cb02007-07-03 07:05:3172 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano103b5722011-01-31 05:03:4584ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano103b5722011-01-31 05:03:4589
Junio C Hamano9d971152012-12-19 00:43:1190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:3194 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9d971152012-12-19 00:43:1198
99#author {
Junio C Hamano1d90cb02007-07-03 07:05:31100 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:31101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1d90cb02007-07-03 07:05:31103}
Junio C Hamano9d971152012-12-19 00:43:11104#email {
Junio C Hamano1d90cb02007-07-03 07:05:31105}
Junio C Hamano9d971152012-12-19 00:43:11106#revnumber, #revdate, #revremark {
Junio C Hamano1d90cb02007-07-03 07:05:31107}
108
Junio C Hamano9d971152012-12-19 00:43:11109#footer {
Junio C Hamano1d90cb02007-07-03 07:05:31110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-text {
Junio C Hamano1d90cb02007-07-03 07:05:31116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9d971152012-12-19 00:43:11119#footer-badges {
Junio C Hamano1d90cb02007-07-03 07:05:31120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9d971152012-12-19 00:43:11124#preamble {
Junio C Hamano103b5722011-01-31 05:03:45125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9d971152012-12-19 00:43:11128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1d90cb02007-07-03 07:05:31129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1d90cb02007-07-03 07:05:31132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1d90cb02007-07-03 07:05:31139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano103b5722011-01-31 05:03:45147 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:31148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1d90cb02007-07-03 07:05:31171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1d90cb02007-07-03 07:05:31178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano103b5722011-01-31 05:03:45184 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1d90cb02007-07-03 07:05:31187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano103b5722011-01-31 05:03:45189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1d90cb02007-07-03 07:05:31191 text-align: right;
192}
Junio C Hamano103b5722011-01-31 05:03:45193
Junio C Hamano9d971152012-12-19 00:43:11194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano103b5722011-01-31 05:03:45197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1d90cb02007-07-03 07:05:31206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1d90cb02007-07-03 07:05:31218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1d90cb02007-07-03 07:05:31223}
224
Junio C Hamano1d90cb02007-07-03 07:05:31225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1d90cb02007-07-03 07:05:31226span.image img { border-style: none; }
Junio C Hamano103b5722011-01-31 05:03:45227a.image:visited { color: white; }
Junio C Hamano1d90cb02007-07-03 07:05:31228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano103b5722011-01-31 05:03:45236 font-style: normal;
237 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:31238}
239dd > *:first-child {
Junio C Hamano103b5722011-01-31 05:03:45240 margin-top: 0.1em;
Junio C Hamano1d90cb02007-07-03 07:05:31241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano103b5722011-01-31 05:03:45246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1d90cb02007-07-03 07:05:31250 list-style-type: lower-alpha;
251}
Junio C Hamano103b5722011-01-31 05:03:45252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1d90cb02007-07-03 07:05:31268
Junio C Hamano1d90cb02007-07-03 07:05:31269tfoot {
270 font-weight: bold;
271}
Junio C Hamano103b5722011-01-31 05:03:45272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano103b5722011-01-31 05:03:45275
276div.hdlist {
Junio C Hamano1d90cb02007-07-03 07:05:31277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano103b5722011-01-31 05:03:45280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano103b5722011-01-31 05:03:45283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1d90cb02007-07-03 07:05:31287 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45288 font-style: normal;
Junio C Hamano1d90cb02007-07-03 07:05:31289 padding-right: 0.8em;
Junio C Hamano103b5722011-01-31 05:03:45290 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:31291}
Junio C Hamano103b5722011-01-31 05:03:45292td.hdlist2 {
Junio C Hamano1d90cb02007-07-03 07:05:31293 vertical-align: top;
294}
Junio C Hamano103b5722011-01-31 05:03:45295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1d90cb02007-07-03 07:05:31303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9d971152012-12-19 00:43:11331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1d90cb02007-07-03 07:05:31338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9d971152012-12-19 00:43:11340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9d971152012-12-19 00:43:11348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9d971152012-12-19 00:43:11356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9d971152012-12-19 00:43:11372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano103b5722011-01-31 05:03:45519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9d971152012-12-19 00:43:11524body.manpage h2 {
Junio C Hamano103b5722011-01-31 05:03:45525 border-style: none;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano103b5722011-01-31 05:03:45529}
530
531@media print {
Junio C Hamano9d971152012-12-19 00:43:11532 body.manpage div#toc { display: none; }
Junio C Hamano103b5722011-01-31 05:03:45533}
534
Junio C Hamano1d90cb02007-07-03 07:05:31535
Junio C Hamano1d90cb02007-07-03 07:05:31536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9d971152012-12-19 00:43:11580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9d971152012-12-19 00:43:11670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9d971152012-12-19 00:43:11703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9d971152012-12-19 00:43:11728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1d90cb02007-07-03 07:05:31731</head>
Junio C Hamano9d971152012-12-19 00:43:11732<body class="manpage">
Junio C Hamano1d90cb02007-07-03 07:05:31733<div id="header">
734<h1>
735git-stash(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-stash -
740 Stash the changes in a dirty working directory away
741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11745<div class="sect1">
Junio C Hamano103b5722011-01-31 05:03:45746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31747<div class="sectionbody">
748<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11749<pre class="content"><em>git stash</em> list [&lt;options&gt;]
Junio C Hamano2c14c8d2009-07-02 03:17:00750<em>git stash</em> show [&lt;stash&gt;]
751<em>git stash</em> drop [-q|--quiet] [&lt;stash&gt;]
752<em>git stash</em> ( pop | apply ) [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano46a38aa2008-07-14 03:13:27753<em>git stash</em> branch &lt;branchname&gt; [&lt;stash&gt;]
Junio C Hamano50757392013-06-27 22:26:58754<em>git stash</em> [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
Junio C Hamano8a914312013-08-14 20:47:41755 [-u|--include-untracked] [-a|--all] [&lt;message&gt;]]
Junio C Hamano9e96a1a2008-08-16 10:23:18756<em>git stash</em> clear
Junio C Hamano50757392013-06-27 22:26:58757<em>git stash</em> create [&lt;message&gt;]
758<em>git stash</em> store [-m|--message &lt;message&gt;] [-q|--quiet] &lt;commit&gt;</pre>
Junio C Hamano9d971152012-12-19 00:43:11759<div class="attribution">
Junio C Hamano103b5722011-01-31 05:03:45760</div></div>
Junio C Hamano1d90cb02007-07-03 07:05:31761</div>
Junio C Hamano9d971152012-12-19 00:43:11762</div>
763<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31764<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31765<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:11766<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:31767working directory and the index, but want to go back to a clean
768working directory. The command saves your local modifications away
Junio C Hamano9d971152012-12-19 00:43:11769and reverts the working directory to match the <code>HEAD</code> commit.</p></div>
Junio C Hamano103b5722011-01-31 05:03:45770<div class="paragraph"><p>The modifications stashed away by this command can be listed with
Junio C Hamano9d971152012-12-19 00:43:11771<code>git stash list</code>, inspected with <code>git stash show</code>, and restored
772(potentially on top of a different commit) with <code>git stash apply</code>.
773Calling <code>git stash</code> without any arguments is equivalent to <code>git stash save</code>.
Junio C Hamanofce7c7e2008-07-02 03:06:38774A stash is by default listed as "WIP on <em>branchname</em> &#8230;", but
Junio C Hamanobb6e0782007-07-19 02:14:50775you can give a more descriptive message on the command line when
Junio C Hamanoba4b9282008-07-06 05:20:31776you create one.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11777<div class="paragraph"><p>The latest stash you created is stored in <code>refs/stash</code>; older
Junio C Hamano1d90cb02007-07-03 07:05:31778stashes are found in the reflog of this reference and can be named using
Junio C Hamano9d971152012-12-19 00:43:11779the usual reflog syntax (e.g. <code>stash@{0}</code> is the most recently
780created stash, <code>stash@{1}</code> is the one before it, <code>stash@{2.hours.ago}</code>
Junio C Hamanoba4b9282008-07-06 05:20:31781is also possible).</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31782</div>
Junio C Hamano9d971152012-12-19 00:43:11783</div>
784<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31785<h2 id="_options">OPTIONS</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31786<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45787<div class="dlist"><dl>
788<dt class="hdlist1">
Junio C Hamano8a914312013-08-14 20:47:41789save [-p|--patch] [--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [&lt;message&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31790</dt>
791<dd>
792<p>
Junio C Hamano9d971152012-12-19 00:43:11793 Save your local modifications to a new <em>stash</em>, and run <code>git reset
794 --hard</code> to revert them. The &lt;message&gt; part is optional and gives
Junio C Hamanoc28068f2009-09-08 00:55:23795 the description along with the stashed state. For quickly making
Junio C Hamano103b5722011-01-31 05:03:45796 a snapshot, you can omit <em>both</em> "save" and &lt;message&gt;, but giving
Junio C Hamanoc28068f2009-09-08 00:55:23797 only &lt;message&gt; does not trigger this action to prevent a misspelled
798 subcommand from making an unwanted stash.
Junio C Hamano1d90cb02007-07-03 07:05:31799</p>
Junio C Hamano9d971152012-12-19 00:43:11800<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:27801index are left intact.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11802<div class="paragraph"><p>If the <code>--include-untracked</code> option is used, all untracked files are also
803stashed and then cleaned up with <code>git clean</code>, leaving the working directory
804in a very clean state. If the <code>--all</code> option is used instead then the
Junio C Hamano15567bc2011-07-23 00:51:59805ignored files are stashed and cleaned in addition to the untracked files.</p></div>
Junio C Hamano9d971152012-12-19 00:43:11806<div class="paragraph"><p>With <code>--patch</code>, you can interactively select hunks from the diff
Junio C Hamanoc28068f2009-09-08 00:55:23807between HEAD and the working tree to be stashed. The stash entry is
808constructed such that its index state is the same as the index state
809of your repository, and its worktree contains only the changes you
810selected interactively. The selected changes are then rolled back
Junio C Hamano9d971152012-12-19 00:43:11811from your worktree. See the &#8220;Interactive Mode&#8221; section of
812<a href="git-add.html">git-add(1)</a> to learn how to operate the <code>--patch</code> mode.</p></div>
813<div class="paragraph"><p>The <code>--patch</code> option implies <code>--keep-index</code>. You can use
814<code>--no-keep-index</code> to override this.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31815</dd>
Junio C Hamano103b5722011-01-31 05:03:45816<dt class="hdlist1">
Junio C Hamano83d46a22008-02-21 02:29:42817list [&lt;options&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31818</dt>
819<dd>
820<p>
821 List the stashes that you currently have. Each <em>stash</em> is listed
Junio C Hamano9d971152012-12-19 00:43:11822 with its name (e.g. <code>stash@{0}</code> is the latest stash, <code>stash@{1}</code> is
Junio C Hamano1d90cb02007-07-03 07:05:31823 the one before, etc.), the name of the branch that was current when the
824 stash was made, and a short description of the commit the stash was
825 based on.
826</p>
827<div class="listingblock">
828<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11829<pre><code>stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation
830stash@{1}: On master: 9cc0589... Add git-stash</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31831</div></div>
Junio C Hamano103b5722011-01-31 05:03:45832<div class="paragraph"><p>The command takes options applicable to the <em>git log</em>
Junio C Hamanoa28a9202012-06-21 07:08:23833command 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:31834</dd>
Junio C Hamano103b5722011-01-31 05:03:45835<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31836show [&lt;stash&gt;]
837</dt>
838<dd>
839<p>
Junio C Hamano764a6672007-10-23 01:23:31840 Show the changes recorded in the stash as a diff between the
Junio C Hamano9d971152012-12-19 00:43:11841 stashed state and its original parent. When no <code>&lt;stash&gt;</code> is given,
Junio C Hamano1d90cb02007-07-03 07:05:31842 shows the latest one. By default, the command shows the diffstat, but
Junio C Hamano9d971152012-12-19 00:43:11843 it will accept any format known to <em>git diff</em> (e.g., <code>git stash show
844 -p stash@{1}</code> to view the second most recent stash in patch form).
Junio C Hamano1d90cb02007-07-03 07:05:31845</p>
846</dd>
Junio C Hamano103b5722011-01-31 05:03:45847<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00848pop [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano7d3275e2009-05-31 21:53:30849</dt>
850<dd>
851<p>
852 Remove a single stashed state from the stash list and apply it
853 on top of the current working tree state, i.e., do the inverse
Junio C Hamano9d971152012-12-19 00:43:11854 operation of <code>git stash save</code>. The working directory must
Junio C Hamano7d3275e2009-05-31 21:53:30855 match the index.
856</p>
Junio C Hamano103b5722011-01-31 05:03:45857<div class="paragraph"><p>Applying the state can fail with conflicts; in this case, it is not
Junio C Hamano7d3275e2009-05-31 21:53:30858removed from the stash list. You need to resolve the conflicts by hand
Junio C Hamano9d971152012-12-19 00:43:11859and call <code>git stash drop</code> manually afterwards.</p></div>
860<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:45861tree&#8217;s changes, but also the index&#8217;s ones. However, this can fail, when you
Junio C Hamanof068d542009-06-09 15:46:41862have conflicts (which are stored in the index, where you therefore can no
863longer apply the changes as they were originally).</p></div>
Junio C Hamano9d971152012-12-19 00:43:11864<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
865be a reference of the form <code>stash@{&lt;revision&gt;}</code>.</p></div>
Junio C Hamano7d3275e2009-05-31 21:53:30866</dd>
Junio C Hamano103b5722011-01-31 05:03:45867<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00868apply [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31869</dt>
870<dd>
871<p>
Junio C Hamano9d971152012-12-19 00:43:11872 Like <code>pop</code>, but do not remove the state from the stash list. Unlike <code>pop</code>,
873 <code>&lt;stash&gt;</code> may be any commit that looks like a commit created by
874 <code>stash save</code> or <code>stash create</code>.
Junio C Hamano1d90cb02007-07-03 07:05:31875</p>
Junio C Hamano1d90cb02007-07-03 07:05:31876</dd>
Junio C Hamano103b5722011-01-31 05:03:45877<dt class="hdlist1">
Junio C Hamano46a38aa2008-07-14 03:13:27878branch &lt;branchname&gt; [&lt;stash&gt;]
879</dt>
880<dd>
881<p>
Junio C Hamano9d971152012-12-19 00:43:11882 Creates and checks out a new branch named <code>&lt;branchname&gt;</code> starting from
883 the commit at which the <code>&lt;stash&gt;</code> was originally created, applies the
884 changes recorded in <code>&lt;stash&gt;</code> to the new working tree and index.
885 If that succeeds, and <code>&lt;stash&gt;</code> is a reference of the form
886 <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:27887 is given, applies the latest one.
888</p>
Junio C Hamano9d971152012-12-19 00:43:11889<div class="paragraph"><p>This is useful if the branch on which you ran <code>git stash save</code> has
890changed enough that <code>git stash apply</code> fails due to conflicts. Since
Junio C Hamano46a38aa2008-07-14 03:13:27891the stash is applied on top of the commit that was HEAD at the time
Junio C Hamano9d971152012-12-19 00:43:11892<code>git stash</code> was run, it restores the originally stashed state with
Junio C Hamano46a38aa2008-07-14 03:13:27893no conflicts.</p></div>
894</dd>
Junio C Hamano103b5722011-01-31 05:03:45895<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31896clear
897</dt>
898<dd>
899<p>
900 Remove all the stashed states. Note that those states will then
Junio C Hamano9f883862009-08-11 06:23:52901 be subject to pruning, and may be impossible to recover (see
902 <em>Examples</em> below for a possible strategy).
Junio C Hamano1d90cb02007-07-03 07:05:31903</p>
904</dd>
Junio C Hamano103b5722011-01-31 05:03:45905<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00906drop [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano86bcccc2008-03-08 09:33:55907</dt>
908<dd>
909<p>
Junio C Hamano9d971152012-12-19 00:43:11910 Remove a single stashed state from the stash list. When no <code>&lt;stash&gt;</code>
911 is given, it removes the latest one. i.e. <code>stash@{0}</code>, otherwise
912 <code>&lt;stash&gt;</code> must be a valid stash log reference of the form
913 <code>stash@{&lt;revision&gt;}</code>.
Junio C Hamano86bcccc2008-03-08 09:33:55914</p>
915</dd>
Junio C Hamano103b5722011-01-31 05:03:45916<dt class="hdlist1">
Junio C Hamano9e96a1a2008-08-16 10:23:18917create
918</dt>
919<dd>
920<p>
921 Create a stash (which is a regular commit object) and return its
922 object name, without storing it anywhere in the ref namespace.
Junio C Hamano50757392013-06-27 22:26:58923 This is intended to be useful for scripts. It is probably not
924 the command you want to use; see "save" above.
925</p>
926</dd>
927<dt class="hdlist1">
928store
929</dt>
930<dd>
931<p>
932 Store a given stash created via <em>git stash create</em> (which is a
933 dangling merge commit) in the stash ref, updating the stash
934 reflog. This is intended to be useful for scripts. It is
935 probably not the command you want to use; see "save" above.
Junio C Hamano9e96a1a2008-08-16 10:23:18936</p>
937</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31938</dl></div>
Junio C Hamano1d90cb02007-07-03 07:05:31939</div>
Junio C Hamano9d971152012-12-19 00:43:11940</div>
941<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31942<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31943<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45944<div class="paragraph"><p>A stash is represented as a commit whose tree records the state of the
Junio C Hamano9d971152012-12-19 00:43:11945working directory, and its first parent is the commit at <code>HEAD</code> when
Junio C Hamano1d90cb02007-07-03 07:05:31946the stash was created. The tree of the second parent records the
947state of the index when the stash is made, and it is made a child of
Junio C Hamano9d971152012-12-19 00:43:11948the <code>HEAD</code> commit. The ancestry graph looks like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31949<div class="literalblock">
950<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11951<pre><code> .----W
Junio C Hamano1d90cb02007-07-03 07:05:31952 / /
Junio C Hamano9d971152012-12-19 00:43:11953-----H----I</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31954</div></div>
Junio C Hamano9d971152012-12-19 00:43:11955<div class="paragraph"><p>where <code>H</code> is the <code>HEAD</code> commit, <code>I</code> is a commit that records the state
956of the index, and <code>W</code> is a commit that records the state of the working
Junio C Hamanoba4b9282008-07-06 05:20:31957tree.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31958</div>
Junio C Hamano9d971152012-12-19 00:43:11959</div>
960<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31961<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31962<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45963<div class="dlist"><dl>
964<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31965Pulling into a dirty tree
966</dt>
967<dd>
968<p>
969When you are in the middle of something, you learn that there are
970upstream changes that are possibly relevant to what you are
971doing. When your local changes do not conflict with the changes in
Junio C Hamano9d971152012-12-19 00:43:11972the upstream, a simple <code>git pull</code> will let you move forward.
Junio C Hamano1d90cb02007-07-03 07:05:31973</p>
Junio C Hamano103b5722011-01-31 05:03:45974<div class="paragraph"><p>However, there are cases in which your local changes do conflict with
Junio C Hamano9d971152012-12-19 00:43:11975the upstream changes, and <code>git pull</code> refuses to overwrite your
Junio C Hamano1d90cb02007-07-03 07:05:31976changes. In such a case, you can stash your changes away,
Junio C Hamanoba4b9282008-07-06 05:20:31977perform a pull, and then unstash, like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31978<div class="listingblock">
979<div class="content">
Junio C Hamano9d971152012-12-19 00:43:11980<pre><code>$ git pull
Junio C Hamanoa2f46622008-09-03 05:20:31981 ...
Junio C Hamano1d90cb02007-07-03 07:05:31982file foobar not up to date, cannot merge.
983$ git stash
984$ git pull
Junio C Hamano9d971152012-12-19 00:43:11985$ git stash pop</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31986</div></div>
987</dd>
Junio C Hamano103b5722011-01-31 05:03:45988<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31989Interrupted workflow
990</dt>
991<dd>
992<p>
993When you are in the middle of something, your boss comes in and
994demands that you fix something immediately. Traditionally, you would
995make a commit to a temporary branch to store your changes away, and
996return to your original branch to make the emergency fix, like this:
997</p>
998<div class="listingblock">
999<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111000<pre><code># ... hack hack hack ...
Junio C Hamano1d90cb02007-07-03 07:05:311001$ git checkout -b my_wip
1002$ git commit -a -m "WIP"
1003$ git checkout master
1004$ edit emergency fix
1005$ git commit -a -m "Fix in a hurry"
1006$ git checkout my_wip
1007$ git reset --soft HEAD^
Junio C Hamano9d971152012-12-19 00:43:111008# ... continue hacking ...</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311009</div></div>
Junio C Hamano103b5722011-01-31 05:03:451010<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:311011<div class="listingblock">
1012<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111013<pre><code># ... hack hack hack ...
Junio C Hamano1d90cb02007-07-03 07:05:311014$ git stash
1015$ edit emergency fix
1016$ git commit -a -m "Fix in a hurry"
Junio C Hamano7d3275e2009-05-31 21:53:301017$ git stash pop
Junio C Hamano9d971152012-12-19 00:43:111018# ... continue hacking ...</code></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311019</div></div>
1020</dd>
Junio C Hamano103b5722011-01-31 05:03:451021<dt class="hdlist1">
Junio C Hamano46a38aa2008-07-14 03:13:271022Testing partial commits
1023</dt>
1024<dd>
1025<p>
Junio C Hamano9d971152012-12-19 00:43:111026You can use <code>git stash save --keep-index</code> when you want to make two or
Junio C Hamano46a38aa2008-07-14 03:13:271027more commits out of the changes in the work tree, and you want to test
1028each change before committing:
1029</p>
1030<div class="listingblock">
1031<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111032<pre><code># ... hack hack hack ...
Junio C Hamano46a38aa2008-07-14 03:13:271033$ git add --patch foo # add just first part to the index
1034$ git stash save --keep-index # save all other changes to the stash
1035$ edit/build/test first part
Junio C Hamanoa2f46622008-09-03 05:20:311036$ git commit -m 'First part' # commit fully tested change
Junio C Hamano46a38aa2008-07-14 03:13:271037$ git stash pop # prepare to work on all other changes
Junio C Hamanoa2f46622008-09-03 05:20:311038# ... repeat above five steps until one commit remains ...
Junio C Hamano46a38aa2008-07-14 03:13:271039$ edit/build/test remaining parts
Junio C Hamano9d971152012-12-19 00:43:111040$ git commit foo -m 'Remaining parts'</code></pre>
Junio C Hamano46a38aa2008-07-14 03:13:271041</div></div>
1042</dd>
Junio C Hamano103b5722011-01-31 05:03:451043<dt class="hdlist1">
Junio C Hamano9f883862009-08-11 06:23:521044Recovering stashes that were cleared/dropped erroneously
1045</dt>
1046<dd>
1047<p>
1048If you mistakenly drop or clear stashes, they cannot be recovered
1049through the normal safety mechanisms. However, you can try the
1050following incantation to get a list of stashes that are still in your
1051repository, but not reachable any more:
1052</p>
1053<div class="listingblock">
1054<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111055<pre><code>git fsck --unreachable |
Junio C Hamano9f883862009-08-11 06:23:521056grep commit | cut -d\ -f3 |
Junio C Hamano9d971152012-12-19 00:43:111057xargs git log --merges --no-walk --grep=WIP</code></pre>
Junio C Hamano9f883862009-08-11 06:23:521058</div></div>
1059</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311060</dl></div>
Junio C Hamano1d90cb02007-07-03 07:05:311061</div>
Junio C Hamano9d971152012-12-19 00:43:111062</div>
1063<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311064<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1d90cb02007-07-03 07:05:311065<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231066<div class="paragraph"><p><a href="git-checkout.html">git-checkout(1)</a>,
1067<a href="git-commit.html">git-commit(1)</a>,
1068<a href="git-reflog.html">git-reflog(1)</a>,
1069<a href="git-reset.html">git-reset(1)</a></p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311070</div>
Junio C Hamano9d971152012-12-19 00:43:111071</div>
1072<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311073<h2 id="_git">GIT</h2>
Junio C Hamano1d90cb02007-07-03 07:05:311074<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231075<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311076</div>
Junio C Hamano7bd050f2011-09-22 06:32:221077</div>
Junio C Hamano9d971152012-12-19 00:43:111078</div>
Junio C Hamano7bd050f2011-09-22 06:32:221079<div id="footnotes"><hr /></div>
Junio C Hamano1d90cb02007-07-03 07:05:311080<div id="footer">
1081<div id="footer-text">
Junio C Hamano8a914312013-08-14 20:47:411082Last updated 2013-08-14 13:47:23 PDT
Junio C Hamano1d90cb02007-07-03 07:05:311083</div>
1084</div>
1085</body>
1086</html>