checkout-index
NAME名
git-checkout-index - Copy files from the index to the working treegit-checkout-index - インデックスから作業ツリーにファイルをコピーする
SYNOPSIS概要
git checkout-index [-u] [-q] [-a] [-f] [-n] [--prefix=<string>] [--stage=<number>|all] [--temp] [-z] [--stdin] [--] [<file>…]
DESCRIPTION説明
Will copy all files listed from the index to the working directory (not overwriting existing files).インデックスから一覧表示されたすべてのファイルを作業ディレクトリにコピーします(既存のファイルを上書きしません)。
OPTIONSオプション
- -u
- --index - インデックス
-
update stat information for the checked out entries in the index file.インデックスファイルのチェックアウトされたエントリの統計情報を更新します。
- -q
- --quiet - 静か
-
be quiet if files exist or are not in the indexファイルが存在するかインデックスにない場合は静かにする
- -f
- --force - 力
-
forces overwrite of existing files既存のファイルを強制的に上書きする
- -a
- --all - すべて
-
checks out all files in the index. Cannot be used together with explicit filenames.インデックス内のすべてのファイルをチェックアウトします。明示的なファイル名と一緒に使用することはできません。
- -n
- --no-create
-
Don’t checkout new files, only refresh files already checked out.新しいファイルをチェックアウトしないで、すでにチェックアウトされているファイルのみを更新します。
- --prefix=<string> --prefix = <文字列>
-
When creating files, prepend <string> (usually a directory including a trailing /)ファイルを作成するときは、<文字列>(通常は末尾の/を含むディレクトリ)を先頭に追加します。
- --stage=<number>|all --stage = <番号> | all
-
Instead of checking out unmerged entries, copy out the files from named stage. <number> must be between 1 and 3. Note: --stage=all automatically implies --temp.マージされていないエントリをチェックアウトする代わりに、名前付きステージからファイルをコピーします。<number>は1から3の間でなければなりません。注:--stage = allは自動的に--tempを意味します。
- --temp
-
Instead of copying the files to the working directory write the content to temporary files. The temporary name associations will be written to stdout.ファイルを作業ディレクトリにコピーする代わりに、コンテンツを一時ファイルに書き込みます。一時的な名前の関連付けは標準出力に書き込まれます。
- --stdin
-
Instead of taking list of paths from the command line, read list of paths from the standard input. Paths are separated by LF (i.e. one path per line) by default.コマンドラインからパスのリストを取得する代わりに、標準入力からパスのリストを読み取ります。パスはデフォルトでLF(つまり1行に1パス)で区切られています。
- -z
-
Only meaningful with
--stdin
; paths are separated with NUL character instead of LF.とだけ意味があり--stdin
ます。パスはLFではなくNUL文字で区切ります。 - -- -
-
Do not interpret any more arguments as options.これ以上引数をオプションとして解釈しないでください。
The order of the flags used to matter, but not anymore.フラグの順序は以前は重要でしたが、もう重要ではありません。
Just doing git checkout-index
does nothing. You probably meant
git checkout-index -a
. And if you want to force it, you want
git checkout-index -f -a
.ただやっgit checkout-index
ても何もしない。あなたはおそらく意味しましたgit checkout-index -a
。そして、あなたがそれを強制したいのなら、あなたは欲しいですgit checkout-index -f -a
。
Intuitiveness is not the goal here. Repeatability is. The reason for the "no arguments means no work" behavior is that from scripts you are supposed to be able to do:ここでは直感が目標ではありません。再現性はです。"引数なし"は動作しないことを意味するのは、スクリプトからできることだからです。
$ find . -name '*.h' -print0 | xargs -0 git checkout-index -f --
which will force all existing *.h
files to be replaced with their
cached copies. If an empty command line implied "all", then this would
force-refresh everything in the index, which was not the point. But
since git checkout-index accepts --stdin it would be faster to use:これにより、既存のすべての*.h
ファイルがキャッシュされたコピーに置き換えられます。空のコマンドラインが "all"を暗示している場合、これはインデックス内のすべてを強制的にリフレッシュすることになりますが、これは重要ではありません。しかし、git checkout-indexは--stdinを受け入れるので、使用するほうが速いでしょう。
$ find . -name '*.h' -print0 | git checkout-index -f -z --stdin
The --
is just a good idea when you know the rest will be filenames;
it will prevent problems with a filename of, for example, -a
.
Using --
is probably a good policy in scripts.--
残りがファイル名になることを知っているとき、これはちょうどいい考えです。たとえば、ファイル名の問題を防ぐことができます-a
。--
スクリプトを使用するのはおそらく良い方針です。
Using --temp or --stage=all--tempまたは--stage = allを使用する
When --temp
is used (or implied by --stage=all
)
git checkout-index will create a temporary file for each index
entry being checked out. The index will not be updated with stat
information. These options can be useful if the caller needs all
stages of all unmerged entries so that the unmerged files can be
processed by an external merge tool.とき--temp
に使用(またはによって暗示される--stage=all
)Gitのチェックアウト・インデックスは、チェックアウトされている各インデックス・エントリのための一時ファイルを作成します。索引は統計情報で更新されません。これらのオプションは、マージされていないファイルを外部マージツールで処理できるように、呼び出し側がすべてのマージされていないエントリのすべてのステージを必要とする場合に便利です。
A listing will be written to stdout providing the association of temporary file names to tracked path names. The listing format has two variations:一時ファイル名と追跡パス名の関連付けを提供するリストが標準出力に書き込まれます。リスト形式には2つのバリエーションがあります。
-
tempname TAB path RS一時名TABパスRS
The first format is what gets used when
--stage
is omitted or is not--stage=all
. The field tempname is the temporary file name holding the file content and path is the tracked path name in the index. Only the requested entries are output.最初の形式は、--stage
が省略されているかどうかにかかわらず使用され--stage=all
ます。フィールドtempnameはファイルの内容を保持する一時ファイル名であり、pathはインデックス内の追跡パス名です。要求されたエントリだけが出力されます。 -
stage1temp SP stage2temp SP stage3tmp TAB path RSstage1temp SP stage2temp SP stage3tmp TABパスRS
The second format is what gets used when
--stage=all
. The three stage temporary fields (stage1temp, stage2temp, stage3temp) list the name of the temporary file if there is a stage entry in the index or.
if there is no stage entry. Paths which only have a stage 0 entry will always be omitted from the output.2番目の形式はいつ使用されるか--stage=all
です。3つのステージ一時フィールド(stage1temp、stage2temp、stage3temp)は、インデックスにステージエントリがある.
場合、またはステージエントリがない場合の一時ファイルの名前をリストします。ステージ0のエントリーしかないパスは、常に出力から除外されます。
In both formats RS (the record separator) is newline by default but will be the null byte if -z was passed on the command line. The temporary file names are always safe strings; they will never contain directory separators or whitespace characters. The path field is always relative to the current directory and the temporary file names are always relative to the top level directory.どちらの形式でも、RS(レコード区切り文字)はデフォルトでは改行ですが、コマンドラインで-zが渡された場合はnullバイトになります。一時ファイル名は常に安全な文字列です。ディレクトリの区切り文字や空白文字は含まれません。pathフィールドは常に現在のディレクトリからの相対パスで、一時ファイル名は常に最上位ディレクトリからの相対パスです。
If the object being copied out to a temporary file is a symbolic link the content of the link will be written to a normal file. It is up to the end-user or the Porcelain to make use of this information.一時ファイルにコピーアウトされているオブジェクトがシンボリックリンクの場合、リンクの内容は通常のファイルに書き込まれます。この情報を利用するのはエンドユーザーまたは磁器次第です。
EXAMPLES例
- To update and refresh only the files already checked out すでにチェックアウトされているファイルのみを更新および更新する
-
$ git checkout-index -n -f -a && git update-index --ignore-missing --refresh
- Using git checkout-index to "export an entire tree" "ツリー全体をエクスポートする"ためのgit checkout-indexの使用
-
The prefix ability basically makes it trivial to use git checkout-index as an "export as tree" function. Just read the desired tree into the index, and do:プレフィックス機能は基本的に"ツリーとしてエクスポート"機能としてgit checkout-indexを使うことを簡単にします。目的のツリーをインデックスに読み込んで、次のようにします。
$ git checkout-index --prefix=git-export-dir/ -a
git checkout-index
will "export" the index into the specified directory.git checkout-index
指定されたディレクトリにインデックスを「エクスポート」します。The final "/" is important. The exported name is literally just prefixed with the specified string. Contrast this with the following example.最後の "/"は重要です。エクスポートされた名前は文字通り単に指定された文字列の接頭辞が付きます。これを次の例と比較してください。
- Export files with a prefix 接頭辞を付けてファイルをエクスポートする
-
$ git checkout-index --prefix=.merged- Makefile
This will check out the currently cached copy of
Makefile
into the file.merged-Makefile
.現在キャッシュされているコピーをMakefile
ファイルにチェックアウトします.merged-Makefile
。
GIT
Part of the git[1] suite一部のgit [1]スイート
関連記事
- write-tree
- verify-pack
- update-ref
- update-index
- symbolic-ref
- show-ref
- rev-parse
- rev-list
- read-tree
- merge-base
- ls-files
- hash-object
- for-each-ref
- diff-index
- count-objects
- commit-tree
- check-ignore
- cat-file
- bundle
- archive
- instaweb
- filter-branch
- reflog
- fsck
- gc
- clean
- Workflows
- Tutorial
- Revisions
- gitmodules
- gitignore
- githooks
- Glossary
- Everyday Git
- gitattributes
- update-server-info
- daemon
- fast-import
- svn
- request-pull
- send-email
- format-patch
- am
- grep
- blame
- bisect
- revert
- rebase
- cherry-pick
- apply
- describe
- shortlog
- show
- submodule
- remote
- push
- pull
- fetch
- worktree
- tag
- stash
- log
- mergetool
- merge
- checkout
- branch
- mv
- rm
- reset
- commit
- diff
- status
- add
- clone
- init
- help
- config
- git
スポンサーリンク