blob: 2824db55fd3cb995db98ecfc0e995a1944b26bb2 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!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>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanodecf50e2006-03-05 10:51:146<meta name="generator" content="AsciiDoc 7.0.2" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-checkout-index(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-checkout-index(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-checkout-index -
269 Copy files from the index to the working directory
270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58275<div class="verseblock">
276<div class="content"><em>git-checkout-index</em> [-u] [-q] [-a] [-f] [-n] [--prefix=&lt;string&gt;]
Junio C Hamanof84a2b12006-03-07 05:16:28277 [--stage=&lt;number&gt;|all]
278 [--temp]
Junio C Hamanodecf50e2006-03-05 10:51:14279 [-z] [--stdin]
280 [--] [&lt;file&gt;]*</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23281</div>
282<h2>DESCRIPTION</h2>
283<div class="sectionbody">
284<p>Will copy all files listed from the index to the working directory
285(not overwriting existing files).</p>
286</div>
287<h2>OPTIONS</h2>
288<div class="sectionbody">
289<dl>
290<dt>
291-u|--index
292</dt>
293<dd>
294<p>
295 update stat information for the checked out entries in
296 the index file.
297</p>
298</dd>
299<dt>
300-q|--quiet
301</dt>
302<dd>
303<p>
304 be quiet if files exist or are not in the index
305</p>
306</dd>
307<dt>
308-f|--force
309</dt>
310<dd>
311<p>
312 forces overwrite of existing files
313</p>
314</dd>
315<dt>
316-a|--all
317</dt>
318<dd>
319<p>
320 checks out all files in the index. Cannot be used
321 together with explicit filenames.
322</p>
323</dd>
324<dt>
325-n|--no-create
326</dt>
327<dd>
328<p>
329 Don't checkout new files, only refresh files already checked
330 out.
331</p>
332</dd>
333<dt>
334--prefix=&lt;string&gt;
335</dt>
336<dd>
337<p>
338 When creating files, prepend &lt;string&gt; (usually a directory
339 including a trailing /)
340</p>
341</dd>
342<dt>
Junio C Hamanof84a2b12006-03-07 05:16:28343--stage=&lt;number&gt;|all
Junio C Hamano1a4e8412005-12-27 08:17:23344</dt>
345<dd>
346<p>
347 Instead of checking out unmerged entries, copy out the
348 files from named stage. &lt;number&gt; must be between 1 and 3.
Junio C Hamanof84a2b12006-03-07 05:16:28349 Note: --stage=all automatically implies --temp.
350</p>
351</dd>
352<dt>
353--temp
354</dt>
355<dd>
356<p>
357 Instead of copying the files to the working directory
358 write the content to temporary files. The temporary name
359 associations will be written to stdout.
Junio C Hamano1a4e8412005-12-27 08:17:23360</p>
361</dd>
362<dt>
Junio C Hamanodecf50e2006-03-05 10:51:14363--stdin
364</dt>
365<dd>
366<p>
367 Instead of taking list of paths from the command line,
368 read list of paths from the standard input. Paths are
369 separated by LF (i.e. one path per line) by default.
370</p>
371</dd>
372<dt>
373-z
374</dt>
375<dd>
376<p>
377 Only meaningful with <tt>--stdin</tt>; paths are separated with
378 NUL character instead of LF.
379</p>
380</dd>
381<dt>
Junio C Hamano1bb569e2006-05-05 23:14:25382--
Junio C Hamano1a4e8412005-12-27 08:17:23383</dt>
384<dd>
385<p>
386 Do not interpret any more arguments as options.
387</p>
388</dd>
389</dl>
390<p>The order of the flags used to matter, but not anymore.</p>
391<p>Just doing <tt>git-checkout-index</tt> does nothing. You probably meant
392<tt>git-checkout-index -a</tt>. And if you want to force it, you want
393<tt>git-checkout-index -f -a</tt>.</p>
394<p>Intuitiveness is not the goal here. Repeatability is. The reason for
395the "no arguments means no work" behavior is that from scripts you are
396supposed to be able to do:</p>
397<div class="listingblock">
398<div class="content">
399<pre><tt>$ find . -name '*.h' -print0 | xargs -0 git-checkout-index -f --</tt></pre>
400</div></div>
401<p>which will force all existing <tt>*.h</tt> files to be replaced with their
402cached copies. If an empty command line implied "all", then this would
Junio C Hamanodecf50e2006-03-05 10:51:14403force-refresh everything in the index, which was not the point. But
404since git-checkout-index accepts --stdin it would be faster to use:</p>
405<div class="listingblock">
406<div class="content">
407<pre><tt>$ find . -name '*.h' -print0 | git-checkout-index -f -z --stdin</tt></pre>
408</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23409<p>The <tt>--</tt> is just a good idea when you know the rest will be filenames;
410it will prevent problems with a filename of, for example, <tt>-a</tt>.
411Using <tt>--</tt> is probably a good policy in scripts.</p>
412</div>
Junio C Hamanof84a2b12006-03-07 05:16:28413<h2>Using --temp or --stage=all</h2>
414<div class="sectionbody">
415<p>When <tt>--temp</tt> is used (or implied by <tt>--stage=all</tt>)
416<tt>git-checkout-index</tt> will create a temporary file for each index
417entry being checked out. The index will not be updated with stat
418information. These options can be useful if the caller needs all
419stages of all unmerged entries so that the unmerged files can be
420processed by an external merge tool.</p>
421<p>A listing will be written to stdout providing the association of
422temporary file names to tracked path names. The listing format
423has two variations:</p>
424<ol>
425<li>
426<p>
427tempname TAB path RS
428</p>
429<p>The first format is what gets used when <tt>--stage</tt> is omitted or
430is not <tt>--stage=all</tt>. The field tempname is the temporary file
431name holding the file content and path is the tracked path name in
432the index. Only the requested entries are output.</p>
433</li>
434<li>
435<p>
436stage1temp SP stage2temp SP stage3tmp TAB path RS
437</p>
438<p>The second format is what gets used when <tt>--stage=all</tt>. The three
439stage temporary fields (stage1temp, stage2temp, stage3temp) list the
440name of the temporary file if there is a stage entry in the index
441or <tt>.</tt> if there is no stage entry. Paths which only have a stage 0
442entry will always be omitted from the output.</p>
443</li>
444</ol>
445<p>In both formats RS (the record separator) is newline by default
446but will be the null byte if -z was passed on the command line.
447The temporary file names are always safe strings; they will never
448contain directory separators or whitespace characters. The path
449field is always relative to the current directory and the temporary
450file names are always relative to the top level directory.</p>
451<p>If the object being copied out to a temporary file is a symbolic
452link the content of the link will be written to a normal file. It is
453up to the end-user or the Porcelain to make use of this information.</p>
454</div>
Junio C Hamano1a4e8412005-12-27 08:17:23455<h2>EXAMPLES</h2>
456<div class="sectionbody">
457<dl>
458<dt>
459To update and refresh only the files already checked out
460</dt>
461<dd>
462<div class="listingblock">
463<div class="content">
464<pre><tt>$ git-checkout-index -n -f -a &amp;&amp; git-update-index --ignore-missing --refresh</tt></pre>
465</div></div>
466</dd>
467<dt>
468Using <tt>git-checkout-index</tt> to "export an entire tree"
469</dt>
470<dd>
471<p>
472 The prefix ability basically makes it trivial to use
473 <tt>git-checkout-index</tt> as an "export as tree" function.
474 Just read the desired tree into the index, and do:
475</p>
476<div class="listingblock">
477<div class="content">
478<pre><tt>$ git-checkout-index --prefix=git-export-dir/ -a</tt></pre>
479</div></div>
480<p><tt>git-checkout-index</tt> will "export" the index into the specified
481directory.</p>
482<p>The final "/" is important. The exported name is literally just
483prefixed with the specified string. Contrast this with the
484following example.</p>
485</dd>
486<dt>
487Export files with a prefix
488</dt>
489<dd>
490<div class="listingblock">
491<div class="content">
492<pre><tt>$ git-checkout-index --prefix=.merged- Makefile</tt></pre>
493</div></div>
494<p>This will check out the currently cached copy of <tt>Makefile</tt>
495into the file <tt>.merged-Makefile</tt>.</p>
496</dd>
497</dl>
498</div>
499<h2>Author</h2>
500<div class="sectionbody">
501<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
502</div>
503<h2>Documentation</h2>
504<div class="sectionbody">
505<p>Documentation by David Greaves,
506Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>
507</div>
508<h2>GIT</h2>
509<div class="sectionbody">
510<p>Part of the <a href="git.html">git(7)</a> suite</p>
511</div>
512<div id="footer">
513<div id="footer-text">
Junio C Hamano1bb569e2006-05-05 23:14:25514Last updated 05-May-2006 23:14:10 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23515</div>
516</div>
517</body>
518</html>