blob: 74dc20230d78c18956fe365b9cadacdcb9601db2 [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" />
Junio C Hamano61525f92014-01-17 22:46:496<meta name="generator" content="AsciiDoc 8.6.6" />
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 Hamano61525f92014-01-17 22:46:4990pre {
Junio C Hamano1d90cb02007-07-03 07:05:3191 padding: 0;
92 margin: 0;
93}
94
Junio C Hamano9d971152012-12-19 00:43:1195#author {
Junio C Hamano1d90cb02007-07-03 07:05:3196 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:3197 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3198 font-size: 1.1em;
Junio C Hamano1d90cb02007-07-03 07:05:3199}
Junio C Hamano9d971152012-12-19 00:43:11100#email {
Junio C Hamano1d90cb02007-07-03 07:05:31101}
Junio C Hamano9d971152012-12-19 00:43:11102#revnumber, #revdate, #revremark {
Junio C Hamano1d90cb02007-07-03 07:05:31103}
104
Junio C Hamano9d971152012-12-19 00:43:11105#footer {
Junio C Hamano1d90cb02007-07-03 07:05:31106 font-size: small;
107 border-top: 2px solid silver;
108 padding-top: 0.5em;
109 margin-top: 4.0em;
110}
Junio C Hamano9d971152012-12-19 00:43:11111#footer-text {
Junio C Hamano1d90cb02007-07-03 07:05:31112 float: left;
113 padding-bottom: 0.5em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-badges {
Junio C Hamano1d90cb02007-07-03 07:05:31116 float: right;
117 padding-bottom: 0.5em;
118}
119
Junio C Hamano9d971152012-12-19 00:43:11120#preamble {
Junio C Hamano103b5722011-01-31 05:03:45121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
123}
Junio C Hamano9d971152012-12-19 00:43:11124div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1d90cb02007-07-03 07:05:31125div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
126div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22127 margin-top: 1.0em;
Junio C Hamano1d90cb02007-07-03 07:05:31128 margin-bottom: 1.5em;
129}
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 2.0em;
132 margin-bottom: 2.0em;
133 margin-right: 10%;
134 color: #606060;
Junio C Hamano1d90cb02007-07-03 07:05:31135}
136
137div.content { /* Block element content. */
138 padding: 0;
139}
140
141/* Block element titles. */
142div.title, caption.title {
Junio C Hamano103b5722011-01-31 05:03:45143 color: #527bbd;
Junio C Hamano1d90cb02007-07-03 07:05:31144 font-weight: bold;
145 text-align: left;
146 margin-top: 1.0em;
147 margin-bottom: 0.5em;
148}
149div.title + * {
150 margin-top: 0;
151}
152
153td div.title:first-child {
154 margin-top: 0.0em;
155}
156div.content div.title:first-child {
157 margin-top: 0.0em;
158}
159div.content + div.title {
160 margin-top: 0.0em;
161}
162
163div.sidebarblock > div.content {
164 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11165 border: 1px solid #dddddd;
166 border-left: 4px solid #f0f0f0;
Junio C Hamano1d90cb02007-07-03 07:05:31167 padding: 0.5em;
168}
169
170div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11171 border: 1px solid #dddddd;
172 border-left: 5px solid #f0f0f0;
173 background: #f8f8f8;
Junio C Hamano1d90cb02007-07-03 07:05:31174 padding: 0.5em;
175}
176
Junio C Hamano7bd050f2011-09-22 06:32:22177div.quoteblock, div.verseblock {
178 padding-left: 1.0em;
179 margin-left: 1.0em;
Junio C Hamano103b5722011-01-31 05:03:45180 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11181 border-left: 5px solid #f0f0f0;
182 color: #888;
Junio C Hamano1d90cb02007-07-03 07:05:31183}
Junio C Hamano7bd050f2011-09-22 06:32:22184
Junio C Hamano103b5722011-01-31 05:03:45185div.quoteblock > div.attribution {
186 padding-top: 0.5em;
Junio C Hamano1d90cb02007-07-03 07:05:31187 text-align: right;
188}
Junio C Hamano103b5722011-01-31 05:03:45189
Junio C Hamano9d971152012-12-19 00:43:11190div.verseblock > pre.content {
191 font-family: inherit;
192 font-size: inherit;
Junio C Hamano103b5722011-01-31 05:03:45193}
194div.verseblock > div.attribution {
195 padding-top: 0.75em;
196 text-align: left;
197}
198/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31199div.verseblock + div.attribution {
200 text-align: left;
201}
Junio C Hamano1d90cb02007-07-03 07:05:31202
203div.admonitionblock .icon {
204 vertical-align: top;
205 font-size: 1.1em;
206 font-weight: bold;
207 text-decoration: underline;
208 color: #527bbd;
209 padding-right: 0.5em;
210}
211div.admonitionblock td.content {
212 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22213 border-left: 3px solid #dddddd;
Junio C Hamano1d90cb02007-07-03 07:05:31214}
215
216div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
218 padding-left: 0.5em;
Junio C Hamano1d90cb02007-07-03 07:05:31219}
220
Junio C Hamano1d90cb02007-07-03 07:05:31221div.imageblock div.content { padding-left: 0; }
Junio C Hamano1d90cb02007-07-03 07:05:31222span.image img { border-style: none; }
Junio C Hamano103b5722011-01-31 05:03:45223a.image:visited { color: white; }
Junio C Hamano1d90cb02007-07-03 07:05:31224
225dl {
226 margin-top: 0.8em;
227 margin-bottom: 0.8em;
228}
229dt {
230 margin-top: 0.5em;
231 margin-bottom: 0;
Junio C Hamano103b5722011-01-31 05:03:45232 font-style: normal;
233 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:31234}
235dd > *:first-child {
Junio C Hamano103b5722011-01-31 05:03:45236 margin-top: 0.1em;
Junio C Hamano1d90cb02007-07-03 07:05:31237}
238
239ul, ol {
240 list-style-position: outside;
241}
Junio C Hamano103b5722011-01-31 05:03:45242ol.arabic {
243 list-style-type: decimal;
244}
245ol.loweralpha {
Junio C Hamano1d90cb02007-07-03 07:05:31246 list-style-type: lower-alpha;
247}
Junio C Hamano103b5722011-01-31 05:03:45248ol.upperalpha {
249 list-style-type: upper-alpha;
250}
251ol.lowerroman {
252 list-style-type: lower-roman;
253}
254ol.upperroman {
255 list-style-type: upper-roman;
256}
257
258div.compact ul, div.compact ol,
259div.compact p, div.compact p,
260div.compact div, div.compact div {
261 margin-top: 0.1em;
262 margin-bottom: 0.1em;
263}
Junio C Hamano1d90cb02007-07-03 07:05:31264
Junio C Hamano1d90cb02007-07-03 07:05:31265tfoot {
266 font-weight: bold;
267}
Junio C Hamano103b5722011-01-31 05:03:45268td > div.verse {
269 white-space: pre;
270}
Junio C Hamano103b5722011-01-31 05:03:45271
272div.hdlist {
Junio C Hamano1d90cb02007-07-03 07:05:31273 margin-top: 0.8em;
274 margin-bottom: 0.8em;
275}
Junio C Hamano103b5722011-01-31 05:03:45276div.hdlist tr {
277 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31278}
Junio C Hamano103b5722011-01-31 05:03:45279dt.hdlist1.strong, td.hdlist1.strong {
280 font-weight: bold;
281}
282td.hdlist1 {
Junio C Hamano1d90cb02007-07-03 07:05:31283 vertical-align: top;
Junio C Hamano103b5722011-01-31 05:03:45284 font-style: normal;
Junio C Hamano1d90cb02007-07-03 07:05:31285 padding-right: 0.8em;
Junio C Hamano103b5722011-01-31 05:03:45286 color: navy;
Junio C Hamano1d90cb02007-07-03 07:05:31287}
Junio C Hamano103b5722011-01-31 05:03:45288td.hdlist2 {
Junio C Hamano1d90cb02007-07-03 07:05:31289 vertical-align: top;
290}
Junio C Hamano103b5722011-01-31 05:03:45291div.hdlist.compact tr {
292 margin: 0;
293 padding-bottom: 0;
294}
295
296.comment {
297 background: yellow;
298}
Junio C Hamano1d90cb02007-07-03 07:05:31299
Junio C Hamano7bd050f2011-09-22 06:32:22300.footnote, .footnoteref {
301 font-size: 0.8em;
302}
303
304span.footnote, span.footnoteref {
305 vertical-align: super;
306}
307
308#footnotes {
309 margin: 20px 0 20px 0;
310 padding: 7px 0 0 0;
311}
312
313#footnotes div.footnote {
314 margin: 0 0 5px 0;
315}
316
317#footnotes hr {
318 border: none;
319 border-top: 1px solid silver;
320 height: 1px;
321 text-align: left;
322 margin-left: 0;
323 width: 20%;
324 min-width: 100px;
325}
326
Junio C Hamano9d971152012-12-19 00:43:11327div.colist td {
328 padding-right: 0.5em;
329 padding-bottom: 0.3em;
330 vertical-align: top;
331}
332div.colist td img {
333 margin-top: 0.3em;
Junio C Hamano1d90cb02007-07-03 07:05:31334}
Junio C Hamanoba4b9282008-07-06 05:20:31335
Junio C Hamano9d971152012-12-19 00:43:11336@media print {
337 #footer-badges { display: none; }
338}
339
340#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22341 margin-bottom: 2.5em;
342}
343
Junio C Hamano9d971152012-12-19 00:43:11344#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31345 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31346 font-size: 1.1em;
347 font-weight: bold;
348 margin-top: 1.0em;
349 margin-bottom: 0.1em;
350}
351
Junio C Hamano61525f92014-01-17 22:46:49352div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31353 margin-top: 0;
354 margin-bottom: 0;
355}
356div.toclevel2 {
357 margin-left: 2em;
358 font-size: 0.9em;
359}
360div.toclevel3 {
361 margin-left: 4em;
362 font-size: 0.9em;
363}
364div.toclevel4 {
365 margin-left: 6em;
366 font-size: 0.9em;
367}
Junio C Hamano9d971152012-12-19 00:43:11368
369span.aqua { color: aqua; }
370span.black { color: black; }
371span.blue { color: blue; }
372span.fuchsia { color: fuchsia; }
373span.gray { color: gray; }
374span.green { color: green; }
375span.lime { color: lime; }
376span.maroon { color: maroon; }
377span.navy { color: navy; }
378span.olive { color: olive; }
379span.purple { color: purple; }
380span.red { color: red; }
381span.silver { color: silver; }
382span.teal { color: teal; }
383span.white { color: white; }
384span.yellow { color: yellow; }
385
386span.aqua-background { background: aqua; }
387span.black-background { background: black; }
388span.blue-background { background: blue; }
389span.fuchsia-background { background: fuchsia; }
390span.gray-background { background: gray; }
391span.green-background { background: green; }
392span.lime-background { background: lime; }
393span.maroon-background { background: maroon; }
394span.navy-background { background: navy; }
395span.olive-background { background: olive; }
396span.purple-background { background: purple; }
397span.red-background { background: red; }
398span.silver-background { background: silver; }
399span.teal-background { background: teal; }
400span.white-background { background: white; }
401span.yellow-background { background: yellow; }
402
403span.big { font-size: 2em; }
404span.small { font-size: 0.6em; }
405
406span.underline { text-decoration: underline; }
407span.overline { text-decoration: overline; }
408span.line-through { text-decoration: line-through; }
409
Junio C Hamano9d971152012-12-19 00:43:11410
411/*
412 * xhtml11 specific
413 *
414 * */
415
Junio C Hamano61525f92014-01-17 22:46:49416tt {
417 font-family: monospace;
418 font-size: inherit;
419 color: navy;
420}
421
Junio C Hamano9d971152012-12-19 00:43:11422div.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
Junio C Hamano61525f92014-01-17 22:46:49455.monospaced {
456 font-family: monospace;
457 font-size: inherit;
458 color: navy;
459}
460
Junio C Hamano9d971152012-12-19 00:43:11461table.tableblock {
462 margin-top: 1.0em;
463 margin-bottom: 1.5em;
464}
465thead, p.tableblock.header {
466 font-weight: bold;
467 color: #527bbd;
468}
469p.tableblock {
470 margin-top: 0;
471}
472table.tableblock {
473 border-width: 3px;
474 border-spacing: 0px;
475 border-style: solid;
476 border-color: #527bbd;
477 border-collapse: collapse;
478}
479th.tableblock, td.tableblock {
480 border-width: 1px;
481 padding: 4px;
482 border-style: solid;
483 border-color: #527bbd;
484}
485
486table.tableblock.frame-topbot {
487 border-left-style: hidden;
488 border-right-style: hidden;
489}
490table.tableblock.frame-sides {
491 border-top-style: hidden;
492 border-bottom-style: hidden;
493}
494table.tableblock.frame-none {
495 border-style: hidden;
496}
497
498th.tableblock.halign-left, td.tableblock.halign-left {
499 text-align: left;
500}
501th.tableblock.halign-center, td.tableblock.halign-center {
502 text-align: center;
503}
504th.tableblock.halign-right, td.tableblock.halign-right {
505 text-align: right;
506}
507
508th.tableblock.valign-top, td.tableblock.valign-top {
509 vertical-align: top;
510}
511th.tableblock.valign-middle, td.tableblock.valign-middle {
512 vertical-align: middle;
513}
514th.tableblock.valign-bottom, td.tableblock.valign-bottom {
515 vertical-align: bottom;
516}
517
518
519/*
520 * manpage specific
521 *
522 * */
523
524body.manpage h1 {
Junio C Hamano103b5722011-01-31 05:03:45525 padding-top: 0.5em;
526 padding-bottom: 0.5em;
527 border-top: 2px solid silver;
528 border-bottom: 2px solid silver;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage h2 {
Junio C Hamano103b5722011-01-31 05:03:45531 border-style: none;
532}
Junio C Hamano9d971152012-12-19 00:43:11533body.manpage div.sectionbody {
534 margin-left: 3em;
Junio C Hamano103b5722011-01-31 05:03:45535}
536
537@media print {
Junio C Hamano9d971152012-12-19 00:43:11538 body.manpage div#toc { display: none; }
Junio C Hamano103b5722011-01-31 05:03:45539}
Junio C Hamano1d90cb02007-07-03 07:05:31540</style>
Junio C Hamano7bd050f2011-09-22 06:32:22541<script type="text/javascript">
542/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22543var asciidoc = { // Namespace.
544
545/////////////////////////////////////////////////////////////////////
546// Table Of Contents generator
547/////////////////////////////////////////////////////////////////////
548
549/* Author: Mihai Bazon, September 2002
550 * http://students.infoiasi.ro/~mishoo
551 *
552 * Table Of Content generator
553 * Version: 0.4
554 *
555 * Feel free to use this script under the terms of the GNU General Public
556 * License, as long as you do not remove or alter this notice.
557 */
558
559 /* modified by Troy D. Hanson, September 2006. License: GPL */
560 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
561
562// toclevels = 1..4.
563toc: function (toclevels) {
564
565 function getText(el) {
566 var text = "";
567 for (var i = el.firstChild; i != null; i = i.nextSibling) {
568 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 text += i.data;
570 else if (i.firstChild != null)
571 text += getText(i);
572 }
573 return text;
574 }
575
576 function TocEntry(el, text, toclevel) {
577 this.element = el;
578 this.text = text;
579 this.toclevel = toclevel;
580 }
581
582 function tocEntries(el, toclevels) {
583 var result = new Array;
Junio C Hamano61525f92014-01-17 22:46:49584 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22585 // Function that scans the DOM tree for header elements (the DOM2
586 // nodeIterator API would be a better technique but not supported by all
587 // browsers).
588 var iterate = function (el) {
589 for (var i = el.firstChild; i != null; i = i.nextSibling) {
590 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
591 var mo = re.exec(i.tagName);
592 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
593 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
594 }
595 iterate(i);
596 }
597 }
598 }
599 iterate(el);
600 return result;
601 }
602
603 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11604 if (!toc) {
605 return;
606 }
607
608 // Delete existing TOC entries in case we're reloading the TOC.
609 var tocEntriesToRemove = [];
610 var i;
611 for (i = 0; i < toc.childNodes.length; i++) {
612 var entry = toc.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49613 if (entry.nodeName == 'div'
Junio C Hamano9d971152012-12-19 00:43:11614 && entry.getAttribute("class")
615 && entry.getAttribute("class").match(/^toclevel/))
616 tocEntriesToRemove.push(entry);
617 }
618 for (i = 0; i < tocEntriesToRemove.length; i++) {
619 toc.removeChild(tocEntriesToRemove[i]);
620 }
621
622 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22623 var entries = tocEntries(document.getElementById("content"), toclevels);
624 for (var i = 0; i < entries.length; ++i) {
625 var entry = entries[i];
626 if (entry.element.id == "")
627 entry.element.id = "_toc_" + i;
628 var a = document.createElement("a");
629 a.href = "#" + entry.element.id;
630 a.appendChild(document.createTextNode(entry.text));
631 var div = document.createElement("div");
632 div.appendChild(a);
633 div.className = "toclevel" + entry.toclevel;
634 toc.appendChild(div);
635 }
636 if (entries.length == 0)
637 toc.parentNode.removeChild(toc);
638},
639
640
641/////////////////////////////////////////////////////////////////////
642// Footnotes generator
643/////////////////////////////////////////////////////////////////////
644
645/* Based on footnote generation code from:
646 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
647 */
648
649footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11650 // Delete existing footnote entries in case we're reloading the footnodes.
651 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22652 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11653 if (!noteholder) {
654 return;
655 }
656 var entriesToRemove = [];
657 for (i = 0; i < noteholder.childNodes.length; i++) {
658 var entry = noteholder.childNodes[i];
Junio C Hamano61525f92014-01-17 22:46:49659 if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11660 entriesToRemove.push(entry);
661 }
662 for (i = 0; i < entriesToRemove.length; i++) {
663 noteholder.removeChild(entriesToRemove[i]);
664 }
665
666 // Rebuild footnote entries.
667 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22668 var spans = cont.getElementsByTagName("span");
669 var refs = {};
670 var n = 0;
671 for (i=0; i<spans.length; i++) {
672 if (spans[i].className == "footnote") {
673 n++;
Junio C Hamano9d971152012-12-19 00:43:11674 var note = spans[i].getAttribute("data-note");
675 if (!note) {
676 // Use [\s\S] in place of . so multi-line matches work.
677 // Because JavaScript has no s (dotall) regex flag.
678 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
679 spans[i].innerHTML =
680 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
681 "' title='View footnote' class='footnote'>" + n + "</a>]";
682 spans[i].setAttribute("data-note", note);
683 }
Junio C Hamano7bd050f2011-09-22 06:32:22684 noteholder.innerHTML +=
685 "<div class='footnote' id='_footnote_" + n + "'>" +
686 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
687 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22688 var id =spans[i].getAttribute("id");
689 if (id != null) refs["#"+id] = n;
690 }
691 }
692 if (n == 0)
693 noteholder.parentNode.removeChild(noteholder);
694 else {
695 // Process footnoterefs.
696 for (i=0; i<spans.length; i++) {
697 if (spans[i].className == "footnoteref") {
698 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
699 href = href.match(/#.*/)[0]; // Because IE return full URL.
700 n = refs[href];
701 spans[i].innerHTML =
702 "[<a href='#_footnote_" + n +
703 "' title='View footnote' class='footnote'>" + n + "</a>]";
704 }
705 }
706 }
Junio C Hamano9d971152012-12-19 00:43:11707},
708
709install: function(toclevels) {
710 var timerId;
711
712 function reinstall() {
713 asciidoc.footnotes();
714 if (toclevels) {
715 asciidoc.toc(toclevels);
716 }
717 }
718
719 function reinstallAndRemoveTimer() {
720 clearInterval(timerId);
721 reinstall();
722 }
723
724 timerId = setInterval(reinstall, 500);
725 if (document.addEventListener)
726 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
727 else
728 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22729}
730
731}
Junio C Hamano9d971152012-12-19 00:43:11732asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22733/*]]>*/
734</script>
Junio C Hamano1d90cb02007-07-03 07:05:31735</head>
Junio C Hamano9d971152012-12-19 00:43:11736<body class="manpage">
Junio C Hamano1d90cb02007-07-03 07:05:31737<div id="header">
738<h1>
739git-stash(1) Manual Page
740</h1>
741<h2>NAME</h2>
742<div class="sectionbody">
743<p>git-stash -
744 Stash the changes in a dirty working directory away
745</p>
746</div>
747</div>
Junio C Hamano7bd050f2011-09-22 06:32:22748<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11749<div class="sect1">
Junio C Hamano103b5722011-01-31 05:03:45750<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31751<div class="sectionbody">
752<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11753<pre class="content"><em>git stash</em> list [&lt;options&gt;]
Junio C Hamano2c14c8d2009-07-02 03:17:00754<em>git stash</em> show [&lt;stash&gt;]
755<em>git stash</em> drop [-q|--quiet] [&lt;stash&gt;]
756<em>git stash</em> ( pop | apply ) [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano46a38aa2008-07-14 03:13:27757<em>git stash</em> branch &lt;branchname&gt; [&lt;stash&gt;]
Junio C Hamano50757392013-06-27 22:26:58758<em>git stash</em> [save [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
Junio C Hamano8a914312013-08-14 20:47:41759 [-u|--include-untracked] [-a|--all] [&lt;message&gt;]]
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 Hamano61525f92014-01-17 22:46:49770<div class="paragraph"><p>Use <tt>git stash</tt> 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 Hamano61525f92014-01-17 22:46:49773and reverts the working directory to match the <tt>HEAD</tt> 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 Hamano61525f92014-01-17 22:46:49775<tt>git stash list</tt>, inspected with <tt>git stash show</tt>, and restored
776(potentially on top of a different commit) with <tt>git stash apply</tt>.
777Calling <tt>git stash</tt> without any arguments is equivalent to <tt>git stash save</tt>.
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 Hamano61525f92014-01-17 22:46:49781<div class="paragraph"><p>The latest stash you created is stored in <tt>refs/stash</tt>; older
Junio C Hamano1d90cb02007-07-03 07:05:31782stashes are found in the reflog of this reference and can be named using
Junio C Hamano61525f92014-01-17 22:46:49783the usual reflog syntax (e.g. <tt>stash@{0}</tt> is the most recently
784created stash, <tt>stash@{1}</tt> is the one before it, <tt>stash@{2.hours.ago}</tt>
Junio C Hamanoba4b9282008-07-06 05:20:31785is also possible).</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31786</div>
Junio C Hamano9d971152012-12-19 00:43:11787</div>
788<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31789<h2 id="_options">OPTIONS</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31790<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45791<div class="dlist"><dl>
792<dt class="hdlist1">
Junio C Hamano81703b22014-03-14 22:00:27793save [-p|--patch] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [&lt;message&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31794</dt>
795<dd>
796<p>
Junio C Hamano61525f92014-01-17 22:46:49797 Save your local modifications to a new <em>stash</em>, and run <tt>git reset
798 --hard</tt> to revert them. The &lt;message&gt; part is optional and gives
Junio C Hamanoc28068f2009-09-08 00:55:23799 the description along with the stashed state. For quickly making
Junio C Hamano103b5722011-01-31 05:03:45800 a snapshot, you can omit <em>both</em> "save" and &lt;message&gt;, but giving
Junio C Hamanoc28068f2009-09-08 00:55:23801 only &lt;message&gt; does not trigger this action to prevent a misspelled
802 subcommand from making an unwanted stash.
Junio C Hamano1d90cb02007-07-03 07:05:31803</p>
Junio C Hamano61525f92014-01-17 22:46:49804<div class="paragraph"><p>If the <tt>--keep-index</tt> option is used, all changes already added to the
Junio C Hamano46a38aa2008-07-14 03:13:27805index are left intact.</p></div>
Junio C Hamano61525f92014-01-17 22:46:49806<div class="paragraph"><p>If the <tt>--include-untracked</tt> option is used, all untracked files are also
807stashed and then cleaned up with <tt>git clean</tt>, leaving the working directory
808in a very clean state. If the <tt>--all</tt> option is used instead then the
Junio C Hamano15567bc2011-07-23 00:51:59809ignored files are stashed and cleaned in addition to the untracked files.</p></div>
Junio C Hamano61525f92014-01-17 22:46:49810<div class="paragraph"><p>With <tt>--patch</tt>, you can interactively select hunks from the diff
Junio C Hamanoc28068f2009-09-08 00:55:23811between HEAD and the working tree to be stashed. The stash entry is
812constructed such that its index state is the same as the index state
813of your repository, and its worktree contains only the changes you
814selected interactively. The selected changes are then rolled back
Junio C Hamano9d971152012-12-19 00:43:11815from your worktree. See the &#8220;Interactive Mode&#8221; section of
Junio C Hamano61525f92014-01-17 22:46:49816<a href="git-add.html">git-add(1)</a> to learn how to operate the <tt>--patch</tt> mode.</p></div>
817<div class="paragraph"><p>The <tt>--patch</tt> option implies <tt>--keep-index</tt>. You can use
818<tt>--no-keep-index</tt> to override this.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31819</dd>
Junio C Hamano103b5722011-01-31 05:03:45820<dt class="hdlist1">
Junio C Hamano83d46a22008-02-21 02:29:42821list [&lt;options&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31822</dt>
823<dd>
824<p>
825 List the stashes that you currently have. Each <em>stash</em> is listed
Junio C Hamano61525f92014-01-17 22:46:49826 with its name (e.g. <tt>stash@{0}</tt> is the latest stash, <tt>stash@{1}</tt> is
Junio C Hamano1d90cb02007-07-03 07:05:31827 the one before, etc.), the name of the branch that was current when the
828 stash was made, and a short description of the commit the stash was
829 based on.
830</p>
831<div class="listingblock">
832<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49833<pre><tt>stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation
834stash@{1}: On master: 9cc0589... Add git-stash</tt></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31835</div></div>
Junio C Hamano103b5722011-01-31 05:03:45836<div class="paragraph"><p>The command takes options applicable to the <em>git log</em>
Junio C Hamanoa28a9202012-06-21 07:08:23837command 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:31838</dd>
Junio C Hamano103b5722011-01-31 05:03:45839<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31840show [&lt;stash&gt;]
841</dt>
842<dd>
843<p>
Junio C Hamano764a6672007-10-23 01:23:31844 Show the changes recorded in the stash as a diff between the
Junio C Hamano61525f92014-01-17 22:46:49845 stashed state and its original parent. When no <tt>&lt;stash&gt;</tt> is given,
Junio C Hamano1d90cb02007-07-03 07:05:31846 shows the latest one. By default, the command shows the diffstat, but
Junio C Hamano61525f92014-01-17 22:46:49847 it will accept any format known to <em>git diff</em> (e.g., <tt>git stash show
848 -p stash@{1}</tt> to view the second most recent stash in patch form).
Junio C Hamano1d90cb02007-07-03 07:05:31849</p>
850</dd>
Junio C Hamano103b5722011-01-31 05:03:45851<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00852pop [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano7d3275e2009-05-31 21:53:30853</dt>
854<dd>
855<p>
856 Remove a single stashed state from the stash list and apply it
857 on top of the current working tree state, i.e., do the inverse
Junio C Hamano61525f92014-01-17 22:46:49858 operation of <tt>git stash save</tt>. The working directory must
Junio C Hamano7d3275e2009-05-31 21:53:30859 match the index.
860</p>
Junio C Hamano103b5722011-01-31 05:03:45861<div class="paragraph"><p>Applying the state can fail with conflicts; in this case, it is not
Junio C Hamano7d3275e2009-05-31 21:53:30862removed from the stash list. You need to resolve the conflicts by hand
Junio C Hamano61525f92014-01-17 22:46:49863and call <tt>git stash drop</tt> manually afterwards.</p></div>
864<div class="paragraph"><p>If the <tt>--index</tt> option is used, then tries to reinstate not only the working
Junio C Hamano103b5722011-01-31 05:03:45865tree&#8217;s changes, but also the index&#8217;s ones. However, this can fail, when you
Junio C Hamanof068d542009-06-09 15:46:41866have conflicts (which are stored in the index, where you therefore can no
867longer apply the changes as they were originally).</p></div>
Junio C Hamano61525f92014-01-17 22:46:49868<div class="paragraph"><p>When no <tt>&lt;stash&gt;</tt> is given, <tt>stash@{0}</tt> is assumed, otherwise <tt>&lt;stash&gt;</tt> must
869be a reference of the form <tt>stash@{&lt;revision&gt;}</tt>.</p></div>
Junio C Hamano7d3275e2009-05-31 21:53:30870</dd>
Junio C Hamano103b5722011-01-31 05:03:45871<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00872apply [--index] [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano1d90cb02007-07-03 07:05:31873</dt>
874<dd>
875<p>
Junio C Hamano61525f92014-01-17 22:46:49876 Like <tt>pop</tt>, but do not remove the state from the stash list. Unlike <tt>pop</tt>,
877 <tt>&lt;stash&gt;</tt> may be any commit that looks like a commit created by
878 <tt>stash save</tt> or <tt>stash create</tt>.
Junio C Hamano1d90cb02007-07-03 07:05:31879</p>
Junio C Hamano1d90cb02007-07-03 07:05:31880</dd>
Junio C Hamano103b5722011-01-31 05:03:45881<dt class="hdlist1">
Junio C Hamano46a38aa2008-07-14 03:13:27882branch &lt;branchname&gt; [&lt;stash&gt;]
883</dt>
884<dd>
885<p>
Junio C Hamano61525f92014-01-17 22:46:49886 Creates and checks out a new branch named <tt>&lt;branchname&gt;</tt> starting from
887 the commit at which the <tt>&lt;stash&gt;</tt> was originally created, applies the
888 changes recorded in <tt>&lt;stash&gt;</tt> to the new working tree and index.
889 If that succeeds, and <tt>&lt;stash&gt;</tt> is a reference of the form
890 <tt>stash@{&lt;revision&gt;}</tt>, it then drops the <tt>&lt;stash&gt;</tt>. When no <tt>&lt;stash&gt;</tt>
Junio C Hamano46a38aa2008-07-14 03:13:27891 is given, applies the latest one.
892</p>
Junio C Hamano61525f92014-01-17 22:46:49893<div class="paragraph"><p>This is useful if the branch on which you ran <tt>git stash save</tt> has
894changed enough that <tt>git stash apply</tt> fails due to conflicts. Since
Junio C Hamano46a38aa2008-07-14 03:13:27895the stash is applied on top of the commit that was HEAD at the time
Junio C Hamano61525f92014-01-17 22:46:49896<tt>git stash</tt> was run, it restores the originally stashed state with
Junio C Hamano46a38aa2008-07-14 03:13:27897no conflicts.</p></div>
898</dd>
Junio C Hamano103b5722011-01-31 05:03:45899<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31900clear
901</dt>
902<dd>
903<p>
904 Remove all the stashed states. Note that those states will then
Junio C Hamano9f883862009-08-11 06:23:52905 be subject to pruning, and may be impossible to recover (see
906 <em>Examples</em> below for a possible strategy).
Junio C Hamano1d90cb02007-07-03 07:05:31907</p>
908</dd>
Junio C Hamano103b5722011-01-31 05:03:45909<dt class="hdlist1">
Junio C Hamano2c14c8d2009-07-02 03:17:00910drop [-q|--quiet] [&lt;stash&gt;]
Junio C Hamano86bcccc2008-03-08 09:33:55911</dt>
912<dd>
913<p>
Junio C Hamano61525f92014-01-17 22:46:49914 Remove a single stashed state from the stash list. When no <tt>&lt;stash&gt;</tt>
915 is given, it removes the latest one. i.e. <tt>stash@{0}</tt>, otherwise
916 <tt>&lt;stash&gt;</tt> must be a valid stash log reference of the form
917 <tt>stash@{&lt;revision&gt;}</tt>.
Junio C Hamano86bcccc2008-03-08 09:33:55918</p>
919</dd>
Junio C Hamano103b5722011-01-31 05:03:45920<dt class="hdlist1">
Junio C Hamano9e96a1a2008-08-16 10:23:18921create
922</dt>
923<dd>
924<p>
925 Create a stash (which is a regular commit object) and return its
926 object name, without storing it anywhere in the ref namespace.
Junio C Hamano50757392013-06-27 22:26:58927 This is intended to be useful for scripts. It is probably not
928 the command you want to use; see "save" above.
929</p>
930</dd>
931<dt class="hdlist1">
932store
933</dt>
934<dd>
935<p>
936 Store a given stash created via <em>git stash create</em> (which is a
937 dangling merge commit) in the stash ref, updating the stash
938 reflog. This is intended to be useful for scripts. It is
939 probably not the command you want to use; see "save" above.
Junio C Hamano9e96a1a2008-08-16 10:23:18940</p>
941</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31942</dl></div>
Junio C Hamano1d90cb02007-07-03 07:05:31943</div>
Junio C Hamano9d971152012-12-19 00:43:11944</div>
945<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31946<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31947<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45948<div class="paragraph"><p>A stash is represented as a commit whose tree records the state of the
Junio C Hamano61525f92014-01-17 22:46:49949working directory, and its first parent is the commit at <tt>HEAD</tt> when
Junio C Hamano1d90cb02007-07-03 07:05:31950the stash was created. The tree of the second parent records the
951state of the index when the stash is made, and it is made a child of
Junio C Hamano61525f92014-01-17 22:46:49952the <tt>HEAD</tt> commit. The ancestry graph looks like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31953<div class="literalblock">
954<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49955<pre><tt> .----W
Junio C Hamano1d90cb02007-07-03 07:05:31956 / /
Junio C Hamano61525f92014-01-17 22:46:49957-----H----I</tt></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31958</div></div>
Junio C Hamano61525f92014-01-17 22:46:49959<div class="paragraph"><p>where <tt>H</tt> is the <tt>HEAD</tt> commit, <tt>I</tt> is a commit that records the state
960of the index, and <tt>W</tt> is a commit that records the state of the working
Junio C Hamanoba4b9282008-07-06 05:20:31961tree.</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31962</div>
Junio C Hamano9d971152012-12-19 00:43:11963</div>
964<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31965<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano1d90cb02007-07-03 07:05:31966<div class="sectionbody">
Junio C Hamano103b5722011-01-31 05:03:45967<div class="dlist"><dl>
968<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31969Pulling into a dirty tree
970</dt>
971<dd>
972<p>
973When you are in the middle of something, you learn that there are
974upstream changes that are possibly relevant to what you are
975doing. When your local changes do not conflict with the changes in
Junio C Hamano61525f92014-01-17 22:46:49976the upstream, a simple <tt>git pull</tt> will let you move forward.
Junio C Hamano1d90cb02007-07-03 07:05:31977</p>
Junio C Hamano103b5722011-01-31 05:03:45978<div class="paragraph"><p>However, there are cases in which your local changes do conflict with
Junio C Hamano61525f92014-01-17 22:46:49979the upstream changes, and <tt>git pull</tt> refuses to overwrite your
Junio C Hamano1d90cb02007-07-03 07:05:31980changes. In such a case, you can stash your changes away,
Junio C Hamanoba4b9282008-07-06 05:20:31981perform a pull, and then unstash, like this:</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:31982<div class="listingblock">
983<div class="content">
Junio C Hamano61525f92014-01-17 22:46:49984<pre><tt>$ git pull
Junio C Hamanoa2f46622008-09-03 05:20:31985 ...
Junio C Hamano1d90cb02007-07-03 07:05:31986file foobar not up to date, cannot merge.
987$ git stash
988$ git pull
Junio C Hamano61525f92014-01-17 22:46:49989$ git stash pop</tt></pre>
Junio C Hamano1d90cb02007-07-03 07:05:31990</div></div>
991</dd>
Junio C Hamano103b5722011-01-31 05:03:45992<dt class="hdlist1">
Junio C Hamano1d90cb02007-07-03 07:05:31993Interrupted workflow
994</dt>
995<dd>
996<p>
997When you are in the middle of something, your boss comes in and
998demands that you fix something immediately. Traditionally, you would
999make a commit to a temporary branch to store your changes away, and
1000return to your original branch to make the emergency fix, like this:
1001</p>
1002<div class="listingblock">
1003<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491004<pre><tt># ... hack hack hack ...
Junio C Hamano1d90cb02007-07-03 07:05:311005$ git checkout -b my_wip
1006$ git commit -a -m "WIP"
1007$ git checkout master
1008$ edit emergency fix
1009$ git commit -a -m "Fix in a hurry"
1010$ git checkout my_wip
1011$ git reset --soft HEAD^
Junio C Hamano61525f92014-01-17 22:46:491012# ... continue hacking ...</tt></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311013</div></div>
Junio C Hamano103b5722011-01-31 05:03:451014<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:311015<div class="listingblock">
1016<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491017<pre><tt># ... hack hack hack ...
Junio C Hamano1d90cb02007-07-03 07:05:311018$ git stash
1019$ edit emergency fix
1020$ git commit -a -m "Fix in a hurry"
Junio C Hamano7d3275e2009-05-31 21:53:301021$ git stash pop
Junio C Hamano61525f92014-01-17 22:46:491022# ... continue hacking ...</tt></pre>
Junio C Hamano1d90cb02007-07-03 07:05:311023</div></div>
1024</dd>
Junio C Hamano103b5722011-01-31 05:03:451025<dt class="hdlist1">
Junio C Hamano46a38aa2008-07-14 03:13:271026Testing partial commits
1027</dt>
1028<dd>
1029<p>
Junio C Hamano61525f92014-01-17 22:46:491030You can use <tt>git stash save --keep-index</tt> when you want to make two or
Junio C Hamano46a38aa2008-07-14 03:13:271031more commits out of the changes in the work tree, and you want to test
1032each change before committing:
1033</p>
1034<div class="listingblock">
1035<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491036<pre><tt># ... hack hack hack ...
Junio C Hamano46a38aa2008-07-14 03:13:271037$ git add --patch foo # add just first part to the index
1038$ git stash save --keep-index # save all other changes to the stash
1039$ edit/build/test first part
Junio C Hamanoa2f46622008-09-03 05:20:311040$ git commit -m 'First part' # commit fully tested change
Junio C Hamano46a38aa2008-07-14 03:13:271041$ git stash pop # prepare to work on all other changes
Junio C Hamanoa2f46622008-09-03 05:20:311042# ... repeat above five steps until one commit remains ...
Junio C Hamano46a38aa2008-07-14 03:13:271043$ edit/build/test remaining parts
Junio C Hamano61525f92014-01-17 22:46:491044$ git commit foo -m 'Remaining parts'</tt></pre>
Junio C Hamano46a38aa2008-07-14 03:13:271045</div></div>
1046</dd>
Junio C Hamano103b5722011-01-31 05:03:451047<dt class="hdlist1">
Junio C Hamano9f883862009-08-11 06:23:521048Recovering stashes that were cleared/dropped erroneously
1049</dt>
1050<dd>
1051<p>
1052If you mistakenly drop or clear stashes, they cannot be recovered
1053through the normal safety mechanisms. However, you can try the
1054following incantation to get a list of stashes that are still in your
1055repository, but not reachable any more:
1056</p>
1057<div class="listingblock">
1058<div class="content">
Junio C Hamano61525f92014-01-17 22:46:491059<pre><tt>git fsck --unreachable |
Junio C Hamano9f883862009-08-11 06:23:521060grep commit | cut -d\ -f3 |
Junio C Hamano61525f92014-01-17 22:46:491061xargs git log --merges --no-walk --grep=WIP</tt></pre>
Junio C Hamano9f883862009-08-11 06:23:521062</div></div>
1063</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311064</dl></div>
Junio C Hamano1d90cb02007-07-03 07:05:311065</div>
Junio C Hamano9d971152012-12-19 00:43:111066</div>
1067<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311068<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1d90cb02007-07-03 07:05:311069<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231070<div class="paragraph"><p><a href="git-checkout.html">git-checkout(1)</a>,
1071<a href="git-commit.html">git-commit(1)</a>,
1072<a href="git-reflog.html">git-reflog(1)</a>,
1073<a href="git-reset.html">git-reset(1)</a></p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311074</div>
Junio C Hamano9d971152012-12-19 00:43:111075</div>
1076<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311077<h2 id="_git">GIT</h2>
Junio C Hamano1d90cb02007-07-03 07:05:311078<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231079<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1d90cb02007-07-03 07:05:311080</div>
Junio C Hamano7bd050f2011-09-22 06:32:221081</div>
Junio C Hamano9d971152012-12-19 00:43:111082</div>
Junio C Hamano7bd050f2011-09-22 06:32:221083<div id="footnotes"><hr /></div>
Junio C Hamano1d90cb02007-07-03 07:05:311084<div id="footer">
1085<div id="footer-text">
Junio C Hamano81703b22014-03-14 22:00:271086Last updated 2014-03-14 14:59:49 PDT
Junio C Hamano1d90cb02007-07-03 07:05:311087</div>
1088</div>
1089</body>
1090</html>