1 <!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">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.4.5" />
7 <title>git-checkout-index(
1)
</title>
8 <style type=
"text/css">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.5em;
116 margin-bottom: 1.5em;
118 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
119 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
120 div
.admonitionblock
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
245 list-style-type: upper-roman
;
248 div
.compact ul
, div
.compact ol
,
249 div
.compact p
, div
.compact p
,
250 div
.compact div
, div
.compact div
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
275 div
.tableblock
> table
[frame
="hsides"] {
276 border-left-style: none
;
277 border-right-style: none
;
279 div
.tableblock
> table
[frame
="vsides"] {
280 border-top-style: none
;
281 border-bottom-style: none
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-checkout-index(
1) Manual Page
409 <div class=
"sectionbody">
410 <p>git-checkout-index -
411 Copy files from the index to the working tree
415 <h2 id=
"_synopsis">SYNOPSIS
</h2>
416 <div class=
"sectionbody">
417 <div class=
"verseblock">
418 <div class=
"verseblock-content"><em>git checkout-index
</em> [-u] [-q] [-a] [-f] [-n] [--prefix=
<string
>]
419 [--stage=
<number
>|all]
422 [--] [
<file
>…]
</div>
423 <div class=
"verseblock-attribution">
426 <h2 id=
"_description">DESCRIPTION
</h2>
427 <div class=
"sectionbody">
428 <div class=
"paragraph"><p>Will copy all files listed from the index to the working directory
429 (not overwriting existing files).
</p></div>
431 <h2 id=
"_options">OPTIONS
</h2>
432 <div class=
"sectionbody">
433 <div class=
"dlist"><dl>
442 update stat information for the checked out entries in
454 be quiet if files exist or are not in the index
465 forces overwrite of existing files
476 checks out all files in the index. Cannot be used
477 together with explicit filenames.
488 Don
’t checkout new files, only refresh files already checked
493 --prefix=
<string
>
497 When creating files, prepend
<string
> (usually a directory
498 including a trailing /)
502 --stage=
<number
>|all
506 Instead of checking out unmerged entries, copy out the
507 files from named stage.
<number
> must be between
1 and
3.
508 Note: --stage=all automatically implies --temp.
516 Instead of copying the files to the working directory
517 write the content to temporary files. The temporary name
518 associations will be written to stdout.
526 Instead of taking list of paths from the command line,
527 read list of paths from the standard input. Paths are
528 separated by LF (i.e. one path per line) by default.
536 Only meaningful with
<tt>--stdin
</tt>; paths are separated with
537 NUL character instead of LF.
545 Do not interpret any more arguments as options.
549 <div class=
"paragraph"><p>The order of the flags used to matter, but not anymore.
</p></div>
550 <div class=
"paragraph"><p>Just doing
<tt>git checkout-index
</tt> does nothing. You probably meant
551 <tt>git checkout-index -a
</tt>. And if you want to force it, you want
552 <tt>git checkout-index -f -a
</tt>.
</p></div>
553 <div class=
"paragraph"><p>Intuitiveness is not the goal here. Repeatability is. The reason for
554 the
"no arguments means no work" behavior is that from scripts you are
555 supposed to be able to do:
</p></div>
556 <div class=
"listingblock">
557 <div class=
"content">
558 <pre><tt>$ find . -name '*.h' -print0 | xargs -
0 git checkout-index -f --
</tt></pre>
560 <div class=
"paragraph"><p>which will force all existing
<tt>*.h
</tt> files to be replaced with their
561 cached copies. If an empty command line implied
"all", then this would
562 force-refresh everything in the index, which was not the point. But
563 since
<em>git checkout-index
</em> accepts --stdin it would be faster to use:
</p></div>
564 <div class=
"listingblock">
565 <div class=
"content">
566 <pre><tt>$ find . -name '*.h' -print0 | git checkout-index -f -z --stdin
</tt></pre>
568 <div class=
"paragraph"><p>The
<tt>--
</tt> is just a good idea when you know the rest will be filenames;
569 it will prevent problems with a filename of, for example,
<tt>-a
</tt>.
570 Using
<tt>--
</tt> is probably a good policy in scripts.
</p></div>
572 <h2 id=
"_using_temp_or_stage_all">Using --temp or --stage=all
</h2>
573 <div class=
"sectionbody">
574 <div class=
"paragraph"><p>When
<tt>--temp
</tt> is used (or implied by
<tt>--stage=all
</tt>)
575 <em>git checkout-index
</em> will create a temporary file for each index
576 entry being checked out. The index will not be updated with stat
577 information. These options can be useful if the caller needs all
578 stages of all unmerged entries so that the unmerged files can be
579 processed by an external merge tool.
</p></div>
580 <div class=
"paragraph"><p>A listing will be written to stdout providing the association of
581 temporary file names to tracked path names. The listing format
582 has two variations:
</p></div>
583 <div class=
"olist arabic"><ol class=
"arabic">
588 <div class=
"paragraph"><p>The first format is what gets used when
<tt>--stage
</tt> is omitted or
589 is not
<tt>--stage=all
</tt>. The field tempname is the temporary file
590 name holding the file content and path is the tracked path name in
591 the index. Only the requested entries are output.
</p></div>
595 stage1temp SP stage2temp SP stage3tmp TAB path RS
597 <div class=
"paragraph"><p>The second format is what gets used when
<tt>--stage=all
</tt>. The three
598 stage temporary fields (stage1temp, stage2temp, stage3temp) list the
599 name of the temporary file if there is a stage entry in the index
600 or
<tt>.
</tt> if there is no stage entry. Paths which only have a stage
0
601 entry will always be omitted from the output.
</p></div>
604 <div class=
"paragraph"><p>In both formats RS (the record separator) is newline by default
605 but will be the null byte if -z was passed on the command line.
606 The temporary file names are always safe strings; they will never
607 contain directory separators or whitespace characters. The path
608 field is always relative to the current directory and the temporary
609 file names are always relative to the top level directory.
</p></div>
610 <div class=
"paragraph"><p>If the object being copied out to a temporary file is a symbolic
611 link the content of the link will be written to a normal file. It is
612 up to the end-user or the Porcelain to make use of this information.
</p></div>
614 <h2 id=
"_examples">EXAMPLES
</h2>
615 <div class=
"sectionbody">
616 <div class=
"dlist"><dl>
618 To update and refresh only the files already checked out
621 <div class=
"listingblock">
622 <div class=
"content">
623 <pre><tt>$ git checkout-index -n -f -a
&& git update-index --ignore-missing --refresh
</tt></pre>
627 Using
<em>git checkout-index
</em> to
"export an entire tree"
631 The prefix ability basically makes it trivial to use
632 <em>git checkout-index
</em> as an
"export as tree" function.
633 Just read the desired tree into the index, and do:
635 <div class=
"listingblock">
636 <div class=
"content">
637 <pre><tt>$ git checkout-index --prefix=git-export-dir/ -a
</tt></pre>
639 <div class=
"paragraph"><p><tt>git checkout-index
</tt> will
"export" the index into the specified
641 <div class=
"paragraph"><p>The final
"/" is important. The exported name is literally just
642 prefixed with the specified string. Contrast this with the
643 following example.
</p></div>
646 Export files with a prefix
649 <div class=
"listingblock">
650 <div class=
"content">
651 <pre><tt>$ git checkout-index --prefix=.merged- Makefile
</tt></pre>
653 <div class=
"paragraph"><p>This will check out the currently cached copy of
<tt>Makefile
</tt>
654 into the file
<tt>.merged-Makefile
</tt>.
</p></div>
658 <h2 id=
"_author">Author
</h2>
659 <div class=
"sectionbody">
660 <div class=
"paragraph"><p>Written by Linus Torvalds
<<a href=
"mailto:torvalds@osdl.org">torvalds@osdl.org
</a>></p></div>
662 <h2 id=
"_documentation">Documentation
</h2>
663 <div class=
"sectionbody">
664 <div class=
"paragraph"><p>Documentation by David Greaves,
665 Junio C Hamano and the git-list
<<a href=
"mailto:git@vger.kernel.org">git@vger.kernel.org
</a>>.
</p></div>
667 <h2 id=
"_git">GIT
</h2>
668 <div class=
"sectionbody">
669 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
672 <div id=
"footer-text">
673 Last updated
2010-
11-
06 00:
41:
57 UTC