update-index

NAME

git-update-index - Register file contents in the working tree to the indexgit-update-index - 作業ツリーのファイルの内容をインデックスに登録する

SYNOPSIS概要

git update-index
	     [--add] [--remove | --force-remove] [--replace]
	     [--refresh] [-q] [--unmerged] [--ignore-missing]
	     [(--cacheinfo <mode>,<object>,<file>)…​]
	     [--chmod=(+|-)x]
	     [--[no-]assume-unchanged]
	     [--[no-]skip-worktree]
	     [--[no-]fsmonitor-valid]
	     [--ignore-submodules]
	     [--[no-]split-index]
	     [--[no-|test-|force-]untracked-cache]
	     [--[no-]fsmonitor]
	     [--really-refresh] [--unresolve] [--again | -g]
	     [--info-only] [--index-info]
	     [-z] [--stdin] [--index-version <n>]
	     [--verbose]
	     [--] [<file>…​]

DESCRIPTION説明

Modifies the index or directory cache. Each file mentioned is updated into the index and any unmerged or needs updating state is cleared.インデックスキャッシュまたはディレクトリキャッシュを変更します。上記の各ファイルはインデックスに更新され、マージされていない状態または更新が必要な状態はすべてクリアされます。

See also git-add[1] for a more user-friendly way to do some of the most common operations on the index.インデックスに対する最も一般的な操作のいくつかを実行するためのよりユーザーフレンドリーな方法についてはgit-add [1]も参照してください。

The way git update-index handles files it is told about can be modified using the various options:道のgitの更新インデックスは、それが様々なオプションを使用して変更することができますについて語られているファイルを処理します。

OPTIONSオプション

--add

If a specified file isn’t in the index already then it’s added. Default behaviour is to ignore new files.指定したファイルがまだインデックスに含まれていない場合は追加されます。デフォルトの動作は新しいファイルを無視することです。

--remove - 削除

If a specified file is in the index but is missing then it’s removed. Default behavior is to ignore removed file.指定されたファイルがインデックスに含まれていても見つからない場合は削除されます。デフォルトの動作は削除されたファイルを無視することです。

--refresh - リフレッシュ

Looks at the current index and checks to see if merges or updates are needed by checking stat() information.現在のインデックスを調べて、stat()情報をチェックして、マージまたは更新が必要かどうかを確認します。

-q

Quiet. If --refresh finds that the index needs an update, the default behavior is to error out. This option makes git update-index continue anyway.静か。--refreshでインデックスの更新が必要であることが判明した場合、デフォルトの動作はエラーです。このオプションはとにかくgit update-indexを継続させます。

--ignore-submodules

Do not try to update submodules. This option is only respected when passed before --refresh.サブモジュールを更新しようとしないでください。このオプションは--refreshの前に渡された場合にのみ尊重されます。

--unmerged - 未統合

If --refresh finds unmerged changes in the index, the default behavior is to error out. This option makes git update-index continue anyway.--refreshがインデックス内にマージされていない変更を検出した場合、デフォルトの動作はエラーになります。このオプションはとにかくgit update-indexを継続させます。

--ignore-missing

Ignores missing files during a --refresh--refreshの間に不足しているファイルを無視します

--cacheinfo <mode>,<object>,<path> --cacheinfo <モード>、<オブジェクト>、<パス>
--cacheinfo <mode> <object> <path> --cacheinfo <モード> <オブジェクト> <パス>

Directly insert the specified info into the index. For backward compatibility, you can also give these three arguments as three separate parameters, but new users are encouraged to use a single-parameter form.指定された情報をインデックスに直接挿入します。下位互換性のために、これら3つの引数を3つの別々のパラメータとして指定することもできますが、新しいユーザは単一パラメータ形式を使用することをお勧めします。

--index-info

Read index information from stdin.標準入力からインデックス情報を読みます。

--chmod=(+|-)x --chmod =(+ | - )x

Set the execute permissions on the updated files.更新されたファイルに実行権限を設定します。

--[no-]assume-unchanged - [no-]仮定 - 変更なし

When this flag is specified, the object names recorded for the paths are not updated. Instead, this option sets/unsets the "assume unchanged" bit for the paths. When the "assume unchanged" bit is on, the user promises not to change the file and allows Git to assume that the working tree file matches what is recorded in the index. If you want to change the working tree file, you need to unset the bit to tell Git. This is sometimes helpful when working with a big project on a filesystem that has very slow lstat(2) system call (e.g. cifs).このフラグを指定すると、パスに記録されたオブジェクト名は更新されません。代わりに、このオプションはパスの「変更を想定しない」ビットを設定/設定解除します。「変更を想定しない」ビットがオンの場合、ユーザーはファイルを変更しないことを約束し、作業ツリーファイルがインデックスに記録されているものと一致するとGitに想定させます。作業ツリーファイルを変更したい場合は、Gitに指示するためにビットを設定解除する必要があります。これは、lstat(2)システムコールが非常に遅いファイルシステム(例えばcifs)で大きなプロジェクトを扱うときに便利です。

Git will fail (gracefully) in case it needs to modify this file in the index e.g. when merging in a commit; thus, in case the assumed-untracked file is changed upstream, you will need to handle the situation manually.Gitは、インデックス内のこのファイルを変更する必要がある場合(例えば、コミットにマージするとき)に(正常に)失敗します。したがって、想定されている追跡されていないファイルが上流で変更された場合は、手動で対処する必要があります。

--really-refresh - 本当にリフレッシュ

Like --refresh, but checks stat information unconditionally, without regard to the "assume unchanged" setting.同様に--refresh、しかしチェックは「変わらないと仮定」の設定に関係なく、無条件にstat情報を。

--[no-]skip-worktree - [no-] skip-worktree

When one of these flags is specified, the object name recorded for the paths are not updated. Instead, these options set and unset the "skip-worktree" bit for the paths. See section "Skip-worktree bit" below for more information.これらのフラグの1つが指定されていると、パスに記録されたオブジェクト名は更新されません。代わりに、これらのオプションはパスの "skip-worktree"ビットを設定および設定解除します。詳細については、後述の「スキップワークツリービット」のセクションを参照してください。

--[no-]fsmonitor-valid - [no-] fsmonitor-valid

When one of these flags is specified, the object name recorded for the paths are not updated. Instead, these options set and unset the "fsmonitor valid" bit for the paths. See section "File System Monitor" below for more information.これらのフラグの1つが指定されていると、パスに記録されたオブジェクト名は更新されません。代わりに、これらのオプションはパスの "fsmonitor valid"ビットを設定および設定解除します。詳細については、後述の「ファイルシステムモニタ」の項を参照してください。

-g
--again - 再び

Runs git update-index itself on the paths whose index entries are different from those from the HEAD commit.実行gitの更新インデックスのインデックスエントリからのものとは異なる経路上自体HEADコミットします。

--unresolve

Restores the unmerged or needs updating state of a file during a merge if it was cleared by accident.復元マージされていないか、更新する必要があり、それが事故でクリアされた場合のマージ中に、ファイルの状態を。

--info-only

Do not create objects in the object database for all <file> arguments that follow this flag; just insert their object IDs into the index.このフラグに続くすべての<file>引数に対してオブジェクトデータベースにオブジェクトを作成しないでください。オブジェクトIDをインデックスに挿入するだけです。

--force-remove

Remove the file from the index even when the working directory still has such a file. (Implies --remove.)作業ディレクトリにまだそのようなファイルがある場合でも、インデックスからファイルを削除します。(暗黙のうちに - 削除)

--replace - 置き換え

By default, when a file path exists in the index, git update-index refuses an attempt to add path/file. Similarly if a file path/file exists, a file path cannot be added. With --replace flag, existing entries that conflict with the entry being added are automatically removed with warning messages.デフォルトでは、ファイルpathがインデックスに存在するとき、git update-indexは追加の試みを拒否しpath/fileます。ファイルpath/fileが存在する場合も同様に、ファイルpathを追加することはできません。--replaceフラグを使用すると、追加されているエントリと競合する既存のエントリは警告メッセージとともに自動的に削除されます。

--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パス)で区切られています。

--verbose - 冗談

Report what is being added and removed from index.インデックスに追加されているものと削除されているものを報告します。

--index-version <n>

Write the resulting index out in the named on-disk format version. Supported versions are 2, 3 and 4. The current default version is 2 or 3, depending on whether extra features are used, such as git add -N.結果のインデックスを、指定されたオンディスク形式のバージョンで書き出します。サポートされているバージョンは2、3、4です。現在のデフォルトバージョンは、などの追加機能が使用されているかどうかに応じて2または3ですgit add -N

Version 4 performs a simple pathname compression that reduces index size by 30%-50% on large repositories, which results in faster load time. Version 4 is relatively young (first released in 1.8.0 in October 2012). Other Git implementations such as JGit and libgit2 may not support it yet.バージョン4では単純なパス名圧縮が実行され、大規模リポジトリではインデックスサイズが30%〜50%縮小されます。これにより、読み込み時間が短縮されます。バージョン4は比較的若いものです(2012年10月の1.8.0で最初にリリースされた)。JGitやlibgit2などの他のGit実装は、まだサポートしていない可能性があります。

-z

Only meaningful with --stdin or --index-info; paths are separated with NUL character instead of LF.--stdinまたはでのみ意味があり--index-infoます。パスはLFではなくNUL文字で区切ります。

--split-index
--no-split-index

Enable or disable split index mode. If split-index mode is already enabled and --split-index is given again, all changes in $GIT_DIR/index are pushed back to the shared index file.分割インデックスモードを有効または無効にします。スプリットインデックスモードが既に有効になっていて--split-index再度与えられた場合、$ GIT_DIR / indexのすべての変更は共有インデックスファイルにプッシュバックされます。

These options take effect whatever the value of the core.splitIndex configuration variable (see git-config[1]). But a warning is emitted when the change goes against the configured value, as the configured value will take effect next time the index is read and this will remove the intended effect of the option.これらのオプションは、core.splitIndex構成変数の値に関係なく有効になります(git-config [1]を参照)。ただし、構成値は次回の索引読み取り時に有効になり、これによってオプションの意図された効果が除去されるため、変更が構成値に反すると警告が出されます。

--untracked-cache
--no-untracked-cache

Enable or disable untracked cache feature. Please use --test-untracked-cache before enabling it.追跡されていないキャッシュ機能を有効または無効にします。--test-untracked-cache有効にする前に使用してください。

These options take effect whatever the value of the core.untrackedCache configuration variable (see git-config[1]). But a warning is emitted when the change goes against the configured value, as the configured value will take effect next time the index is read and this will remove the intended effect of the option.これらのオプションは、core.untrackedCache構成変数の値に関係なく有効になります(git-config [1]を参照)。ただし、構成値は次回の索引読み取り時に有効になり、これによってオプションの意図された効果が除去されるため、変更が構成値に反すると警告が出されます。

--test-untracked-cache

Only perform tests on the working directory to make sure untracked cache can be used. You have to manually enable untracked cache using --untracked-cache or --force-untracked-cache or the core.untrackedCache configuration variable afterwards if you really want to use it. If a test fails the exit code is 1 and a message explains what is not working as needed, otherwise the exit code is 0 and OK is printed.追跡されていないキャッシュが使用できることを確認するために作業ディレクトリでテストのみを実行します。手動で使用して追跡されていないキャッシュを有効にする必要があります--untracked-cache--force-untracked-cache、またはcore.untrackedCacheあなたが本当にそれを使用したい場合は、その後設定変数を。テストが失敗した場合、終了コードは1で、何が機能していないかを説明するメッセージが表示されます。それ以外の場合、終了コードは0で、OKが表示されます。

--force-untracked-cache

Same as --untracked-cache. Provided for backwards compatibility with older versions of Git where --untracked-cache used to imply --test-untracked-cache but this option would enable the extension unconditionally.と同じ--untracked-cacheです。以前は--untracked-cache暗黙のうちにGitの旧バージョンとの後方互換性のために提供されて--test-untracked-cacheいましたが、このオプションは無条件に拡張機能を有効にします。

--fsmonitor
--no-fsmonitor

Enable or disable files system monitor feature. These options take effect whatever the value of the core.fsmonitor configuration variable (see git-config[1]). But a warning is emitted when the change goes against the configured value, as the configured value will take effect next time the index is read and this will remove the intended effect of the option.ファイルシステム監視機能を有効または無効にします。これらのオプションは、core.fsmonitor構成変数の値に関係なく有効になります(git-config [1]を参照)。ただし、構成値は次回の索引読み取り時に有効になり、これによってオプションの意図された効果が除去されるため、変更が構成値に反すると警告が出されます。

-- -

Do not interpret any more arguments as options.これ以上引数をオプションとして解釈しないでください。

<file> <ファイル>

Files to act on. Note that files beginning with . are discarded. This includes ./file and dir/./file. If you don’t want this, then use cleaner names. The same applies to directories ending / and paths with //処理するファイル で始まるファイルに注意してください破棄されます。これにはとが含ま./filedir/./fileます。これを望まないのであれば、よりわかりやすい名前を付けてください。/でパスが//で終わるディレクトリについても同様です。

USING --REFRESH--REFRESHを使用する

--refresh does not calculate a new sha1 file or bring the index up to date for mode/content changes. But what it does do is to "re-match" the stat information of a file with the index, so that you can refresh the index for a file that hasn’t been changed but where the stat entry is out of date.--refresh新しいsha1ファイルを計算したり、モード/コンテンツの変更のためにインデックスを最新にしたりしません。しかし、それはないあなたが変更されていないファイルが、どこのstatエントリが古くなっているため、インデックスを更新することができるようにやっていることへの「再試合」インデックスを持つファイルのSTAT情報が、あります。

For example, you’d want to do this after doing a git read-tree, to link up the stat index details with the proper files.例えば、あなたはgit read-treeをした後にstat indexの詳細を適切なファイルにリンクするためにこれをしたいでしょう。

USING --CACHEINFO OR --INFO-ONLY--CACHEINFOまたは--INFO-ONLYを使用する

--cacheinfo is used to register a file that is not in the current working directory. This is useful for minimum-checkout merging.--cacheinfo現在の作業ディレクトリにないファイルを登録するために使用されます。これは、最小チェックアウトマージに役立ちます。

To pretend you have a file at path with mode and sha1, say:あなたはmodeとsha1のパスにファイルがあるとします。

$ git update-index --add --cacheinfo <mode>,<sha1>,<path>

--info-only is used to register files without placing them in the object database. This is useful for status-only repositories.--info-onlyオブジェクトデータベースに配置せずにファイルを登録するために使用されます。これはステータスのみのリポジトリに役立ちます。

Both --cacheinfo and --info-only behave similarly: the index is updated but the object database isn’t. --cacheinfo is useful when the object is in the database but the file isn’t available locally. --info-only is useful when the file is available, but you do not wish to update the object database.どちら--cacheinfo--info-only同様に振る舞う:インデックスが更新されますが、オブジェクトデータベースがありません。--cacheinfoオブジェクトがデータベース内にあるがファイルがローカルで利用できない場合に便利です。--info-onlyファイルが利用可能であるがオブジェクトデータベースを更新したくない場合に便利です。

USING --INDEX-INFO--INDEX-INFOを使用する

--index-info is a more powerful mechanism that lets you feed multiple entry definitions from the standard input, and designed specifically for scripts. It can take inputs of three formats:--index-info標準入力から複数のエントリ定義を取り込むことを可能にし、スクリプト専用に設計された、より強力なメカニズムです。それは3つのフォーマットの入力を取ることができます:

  1. mode SP type SP sha1 TAB pathモードSPタイプSP sha1 TABパス

    This format is to stuff git ls-tree output into the index.このフォーマットはgit ls-treeインデックスに出力を詰め込みます。

  2. mode SP sha1 SP stage TAB pathモードSP sha1 SPステージTABパス

    This format is to put higher order stages into the index file and matches git ls-files --stage output.このフォーマットは、インデックスファイルに上位のステージを追加するもので、git ls-files --stageの出力と一致します。

  3. mode SP sha1 TAB pathモードSP sha1 TABパス

    This format is no longer produced by any Git command, but is and will continue to be supported by update-index --index-info.このフォーマットは、どのGitコマンドでも作成されなくなりましたが、現在も引き続きサポートされupdate-index --index-infoます。

To place a higher stage entry to the index, the path should first be removed by feeding a mode=0 entry for the path, and then feeding necessary input lines in the third format.インデックスに上位ステージのエントリを配置するには、まずパスにmode = 0エントリを入力し、次に必要な入力行を3番目の形式で入力することでパスを削除する必要があります。

For example, starting with this index:たとえば、次のインデックスから始めます。

$ git ls-files -s
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 0       frotz

you can feed the following input to --index-info:次の入力をすることができます--index-info

$ git update-index --index-info
0 0000000000000000000000000000000000000000	frotz
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1	frotz
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2	frotz

The first line of the input feeds 0 as the mode to remove the path; the SHA-1 does not matter as long as it is well formatted. Then the second and third line feeds stage 1 and stage 2 entries for that path. After the above, we would end up with this:入力の最初の行は、パスを削除するモードとして0を入力します。SHA-1はフォーマットが整っていれば問題ありません。次に、2行目と3行目がそのパスのステージ1とステージ2のエントリに入力されます。上記の後、これで終わります。

$ git ls-files -s
100644 8a1218a1024a212bb3db30becd860315f9f3ac52 1	frotz
100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2	frotz

USING “ASSUME UNCHANGED” BIT"ASSUME UNCHANGED"ビットの使用

Many operations in Git depend on your filesystem to have an efficient lstat(2) implementation, so that st_mtime information for working tree files can be cheaply checked to see if the file contents have changed from the version recorded in the index file. Unfortunately, some filesystems have inefficient lstat(2). If your filesystem is one of them, you can set "assume unchanged" bit to paths you have not changed to cause Git not to do this check. Note that setting this bit on a path does not mean Git will check the contents of the file to see if it has changed — it makes Git to omit any checking and assume it has not changed. When you make changes to working tree files, you have to explicitly tell Git about it by dropping "assume unchanged" bit, either before or after you modify them.Gitの多くの操作は効率的なlstat(2)実装をするためにあなたのファイルシステムに依存しているので、st_mtime作業ツリーファイルの情報はファイルの内容がインデックスファイルに記録されたバージョンから変更されたかどうか確かめて調べることができます。残念ながら、いくつかのファイルシステムは非効率的lstat(2)です。あなたのファイルシステムがそれらのうちの1つであるなら、Gitがこのチェックをしないようにするためにあなたが変更していないパスに "仮定変更"ビットを設定することができます。このビットをパスに設定しても、Gitがファイルの内容をチェックしてファイルが変更されているかどうかを確認するわけではありません。チェックを省略し、変更されていないと見なします。作業ツリーファイルに変更を加えるときは、それらを変更する前または後に、 "未変更を想定"ビットをドロップすることによってGitに明示的に伝える必要があります。

In order to set "assume unchanged" bit, use --assume-unchanged option. To unset, use --no-assume-unchanged. To see which files have the "assume unchanged" bit set, use git ls-files -v (see git-ls-files[1]).「未変更を想定」ビットを設定するには、--assume-unchangedoptionを使用します。設定解除するにはを使用します--no-assume-unchanged。どのファイルに「未変更を想定」ビットが設定されているかを確認するには、git ls-files -vgit-ls-files [1]を参照)を使用します。

The command looks at core.ignorestat configuration variable. When this is true, paths updated with git update-index paths... and paths updated with other Git commands that update both index and working tree (e.g. git apply --index, git checkout-index -u, and git read-tree -u) are automatically marked as "assume unchanged". Note that "assume unchanged" bit is not set if git update-index --refresh finds the working tree file matches the index (use git update-index --really-refresh if you want to mark them as "assume unchanged").コマンドはcore.ignorestat構成変数を調べます。これが当てはまる場合、git update-index paths...インデックスと作業ツリーの両方を更新する他のGitコマンドで更新されたパスと他のGitコマンドで更新されたパス(例:git apply --indexgit checkout-index -ugit read-tree -u)は自動的に "としてマークされます。変更なしとします "#:。作業ツリーファイルがインデックスと一致する場合、「変更なしと仮定」ビットは設定されないことに注意してくださいgit update-index --refreshgit update-index --really-refreshそれらを「変更と仮定」としてマークしたい場合に使用します)。

EXAMPLES

To update and refresh only the files already checked out:すでにチェックアウトされているファイルのみを更新および更新するには

$ git checkout-index -n -f -a && git update-index --ignore-missing --refresh
On an inefficient filesystem with core.ignorestat set core.ignorestatsetを使った非効率的なファイルシステム
$ git update-index --really-refresh              (1)
$ git update-index --no-assume-unchanged foo.c   (2)
$ git diff --name-only                           (3)
$ edit foo.c
$ git diff --name-only                           (4)
M foo.c
$ git update-index foo.c                         (5)
$ git diff --name-only                           (6)
$ edit foo.c
$ git diff --name-only                           (7)
$ git update-index --no-assume-unchanged foo.c   (8)
$ git diff --name-only                           (9)
M foo.c
  1. forces lstat(2) to set "assume unchanged" bits for paths that match index.indexと一致するパスに対して、lstat(2)に「変更を想定しない」ビットの設定を強制します。

  2. mark the path to be edited.編集するパスをマークします。

  3. this does lstat(2) and finds index matches the path.これはlstat(2)をして、インデックスがパスと一致するのを見つけます。

  4. this does lstat(2) and finds index does not match the path.これはlstat(2)を行い、インデックスがパスと一致しないことを検出します。

  5. registering the new version to index sets "assume unchanged" bit.新しいバージョンをインデックスセットに登録すると、「変更なしと想定」ビットが設定されます。

  6. and it is assumed unchanged.そしてそれは変更されないと仮定されます。

  7. even after you edit it.編集した後も

  8. you can tell about the change after the fact.あなたは事実の後に変化について話すことができます。

  9. now it checks with lstat(2) and finds it has been changed.現在はlstat(2)で確認し、変更されたことを確認します。

SKIP-WORKTREE BITスキップワークツリービット

Skip-worktree bit can be defined in one (long) sentence: When reading an entry, if it is marked as skip-worktree, then Git pretends its working directory version is up to date and read the index version instead.Skip-worktreeビットは1つの(長い)文で定義できます。エントリを読み取るときに、そのエントリがskip-worktreeとしてマークされていると、Gitはその作業ディレクトリのバージョンが最新であるかのようにふります。

To elaborate, "reading" means checking for file existence, reading file attributes or file content. The working directory version may be present or absent. If present, its content may match against the index version or not. Writing is not affected by this bit, content safety is still first priority. Note that Git can update working directory file, that is marked skip-worktree, if it is safe to do so (i.e. working directory version matches index version)詳しく言うと、「読み取り」とは、ファイルの存在の確認、ファイル属性またはファイルの内容の読み取りを意味します。作業ディレクトリのバージョンが存在するか存在しない可能性があります。存在する場合、その内容はインデックスバージョンと一致するかどうかが異なります。書き込みはこのビットの影響を受けません、コンテンツの安全性は依然として最優先事項です。安全であれば、Git skip-worktreeとマークされた作業ディレクトリファイル更新することができます(つまり、作業ディレクトリのバージョンはインデックスのバージョンと一致します)。

Although this bit looks similar to assume-unchanged bit, its goal is different from assume-unchanged bit’s. Skip-worktree also takes precedence over assume-unchanged bit when both are set.このビットは、変更なしのビットと似ていますが、その目的は変更なしのビットとは異なります。両方が設定されている場合、スキップワークツリーも想定変更なしビットよりも優先されます。

SPLIT INDEX分割インデックス

This mode is designed for repositories with very large indexes, and aims at reducing the time it takes to repeatedly write these indexes.このモードは、非常に大きなインデックスを持つリポジトリ用に設計されており、これらのインデックスを繰り返し書き込むのにかかる時間を短縮することを目的としています。

In this mode, the index is split into two files, $GIT_DIR/index and $GIT_DIR/sharedindex.<SHA-1>. Changes are accumulated in $GIT_DIR/index, the split index, while the shared index file contains all index entries and stays unchanged.このモードでは、インデックスは$ GIT_DIR / indexと$ GIT_DIR / sharedindex。<SHA-1>の2つのファイルに分割されます。変更は$ GIT_DIR / index(分割インデックス)に累積されますが、共有インデックスファイルにはすべてのインデックスエントリが含まれ、変更されません。

All changes in the split index are pushed back to the shared index file when the number of entries in the split index reaches a level specified by the splitIndex.maxPercentChange config variable (see git-config[1]).分割インデックス内のエントリ数がsplitIndex.maxPercentChange設定変数で指定されたレベルに達すると、分割インデックス内のすべての変更が共有インデックスファイルにプッシュバックされます(git-config [1]を参照)。

Each time a new shared index file is created, the old shared index files are deleted if their modification time is older than what is specified by the splitIndex.sharedIndexExpire config variable (see git-config[1]).新しい共有インデックスファイルが作成されるたびに、変更時刻がsplitIndex.sharedIndexExpire設定変数(git-config [1]を参照)で指定された時間よりも古い場合、古い共有インデックスファイルは削除されます。

To avoid deleting a shared index file that is still used, its modification time is updated to the current time everytime a new split index based on the shared index file is either created or read from.まだ使用されている共有インデックスファイルが削除されないようにするために、その共有インデックスファイルに基づく新しい分割インデックスが作成または読み取られるたびに、その変更時刻が現在の時刻に更新されます。

UNTRACKED CACHE追跡されていないキャッシュ

This cache is meant to speed up commands that involve determining untracked files such as git status.このキャッシュはのような追跡されていないファイルを決定することを含むコマンドをスピードアップするためのものgit statusです。

This feature works by recording the mtime of the working tree directories and then omitting reading directories and stat calls against files in those directories whose mtime hasn’t changed. For this to work the underlying operating system and file system must change the st_mtime field of directories if files in the directory are added, modified or deleted.この機能は、作業ツリーディレクトリのmtimeを記録し、mtimeが変更されていないディレクトリ内のファイルに対するディレクトリの読み取りとstat呼び出しを省略することによって機能します。これが機能するためにst_mtimeは、ディレクトリ内のファイルが追加、変更、または削除された場合に、基盤となるオペレーティングシステムとファイルシステムがディレクトリのフィールドを変更する必要があります。

You can test whether the filesystem supports that with the --test-untracked-cache option. The --untracked-cache option used to implicitly perform that test in older versions of Git, but that’s no longer the case.ファイルシステムがそれをサポートしているかどうかをテストすることができ--test-untracked-cacheます。--untracked-cache以前のバージョンのGitで暗黙のうちにそのテストを実行するためのオプションでしたが、それはもはや当てはまりません。

If you want to enable (or disable) this feature, it is easier to use the core.untrackedCache configuration variable (see git-config[1]) than using the --untracked-cache option to git update-index in each repository, especially if you want to do so across all repositories you use, because you can set the configuration variable to true (or false) in your $HOME/.gitconfig just once and have it affect all repositories you touch.この機能を有効(または無効)にしたい場合は、各リポジトリでオプションを使用するよりも、core.untrackedCache構成変数(git-config [1]を参照)を使用するほうが簡単です。特に、使用するすべてのリポジトリでそうしたい場合はそうです。なぜなら、あなたは一度だけ設定変数を(または)に設定でき、それがあなたが触れたすべてのリポジトリに影響を与えることができるからです。--untracked-cachegit update-indextruefalse$HOME/.gitconfig

When the core.untrackedCache configuration variable is changed, the untracked cache is added to or removed from the index the next time a command reads the index; while when --[no-|force-]untracked-cache are used, the untracked cache is immediately added to or removed from the index.場合core.untrackedCache、構成変数が変更され、追跡されていないキャッシュインデックスからのコマンドは、インデックスを読み取る次回に追加または削除されています。場合ながら--[no-|force-]untracked-cache使用され、追跡されていないキャッシュはすぐに追加またはインデックスから削除されます。

Before 2.17, the untracked cache had a bug where replacing a directory with a symlink to another directory could cause it to incorrectly show files tracked by git as untracked. See the "status: add a failing test showing a core.untrackedCache bug" commit to git.git. A workaround for that is (and this might work for other undiscovered bugs in the future):2.17より前では、追跡されていないキャッシュは、ディレクトリを別のディレクトリへのシンボリックリンクで置き換えると、gitによって追跡されているファイルを追跡不能として誤って表示する可能性がありました。git.gitの「status:core.untrackedCacheバグを示す失敗したテストを追加する」コミットを参照してください。そのための回避策は次のとおりです(これは将来的に他の未発見のバグにも役立つかもしれません):

$ git -c core.untrackedCache=false status

This bug has also been shown to affect non-symlink cases of replacing a directory with a file when it comes to the internal structures of the untracked cache, but no case has been reported where this resulted in wrong "git status" output.このバグは、追跡されていないキャッシュの内部構造に関して、ディレクトリをファイルで置き換えるシンボリックリンク以外のケースにも影響することが示されていますが、これが誤った "git status"出力をもたらすケースは報告されていません。

There are also cases where existing indexes written by git versions before 2.17 will reference directories that don’t exist anymore, potentially causing many "could not open directory" warnings to be printed on "git status". These are new warnings for existing issues that were previously silently discarded.2.17より前のgitバージョンで書かれた既存のインデックスが、もう存在しないディレクトリを参照することもあり、多くの "ディレクトリを開けませんでした"という警告が "git status"に表示される可能性があります。これらは、以前は黙って破棄されていた既存の問題に対する新しい警告です。

As with the bug described above the solution is to one-off do a "git status" run with core.untrackedCache=false to flush out the leftover bad data.上記のバグと同様に、解決策はcore.untrackedCache=false残りの不良データをフラッシュするために"git status"を実行することです。

FILE SYSTEM MONITORファイルシステムモニタ

This feature is intended to speed up git operations for repos that have large working directories.この機能は、大きな作業ディレクトリを持つリポジトリのgit操作を高速化することを目的としています。

It enables git to work together with a file system monitor (see the "fsmonitor-watchman" section of githooks[5]) that can inform it as to what files have been modified. This enables git to avoid having to lstat() every file to find modified files.それはgitがどのファイルが変更されたかに関してそれを知らせることができるファイルシステムモニター(githooks [5]の "fsmonitor-watchman"セクションを参照)と一緒に働くことを可能にします。これにより、gitは、変更されたファイルを見つけるためにすべてのファイルをlstat()する必要がなくなります。

When used in conjunction with the untracked cache, it can further improve performance by avoiding the cost of scanning the entire working directory looking for new files.追跡されていないキャッシュと組み合わせて使用??すると、作業ディレクトリ全体をスキャンして新しいファイルを探すコストを回避することで、パフォーマンスをさらに向上させることができます。

If you want to enable (or disable) this feature, it is easier to use the core.fsmonitor configuration variable (see git-config[1]) than using the --fsmonitor option to git update-index in each repository, especially if you want to do so across all repositories you use, because you can set the configuration variable in your $HOME/.gitconfig just once and have it affect all repositories you touch.この機能を有効(または無効)にしたい場合は、各リポジトリでオプションを使用するよりも、core.fsmonitor構成変数(git-config [1]を参照)を使用するほうが簡単です。特に、使用するすべてのリポジトリでそうしたい場合はそうです。なぜなら、あなたは一度だけ設定変数を設定でき、それがあなたが触れたすべてのリポジトリに影響を与えることができるからです。--fsmonitorgit update-index$HOME/.gitconfig

When the core.fsmonitor configuration variable is changed, the file system monitor is added to or removed from the index the next time a command reads the index. When --[no-]fsmonitor are used, the file system monitor is immediately added to or removed from the index.場合core.fsmonitor、構成変数が変更され、ファイル・システム・モニターは、インデックスからのコマンドは、インデックスを読み取る次回に追加または削除されています。際に--[no-]fsmonitor使用される、ファイル・システム・モニターはすぐに追加またはインデックスから削除されます。

CONFIGURATION設定

The command honors core.filemode configuration variable. If your repository is on a filesystem whose executable bits are unreliable, this should be set to false (see git-config[1]). This causes the command to ignore differences in file modes recorded in the index and the file mode on the filesystem if they differ only on executable bit. On such an unfortunate filesystem, you may need to use git update-index --chmod=.このコマンドはcore.filemode構成変数を受け入れます。実行可能ビットが信頼できないファイルシステム上にリポジトリがある場合は、これをfalseに設定する必要がありますgit-config [1]を参照)。これにより、インデックスに記録されているファイルモードとファイルシステム上のファイルモードの違いが実行可能ビットのみで異なる場合、コマンドはその違いを無視します。このような不幸なファイルシステムでは、git update-index --chmod =を使う必要があるかもしれません。

Quite similarly, if core.symlinks configuration variable is set to false (see git-config[1]), symbolic links are checked out as plain files, and this command does not modify a recorded file mode from symbolic link to regular file.同様に、core.symlinks設定変数がfalseに設定されている場合git-config [1]を参照)、シンボリックリンクはプレーンファイルとしてチェックアウトされ、このコマンドは記録されたファイルモードをシンボリックリンクから通常のファイルに変更しません。

The command looks at core.ignorestat configuration variable. See Using "assume unchanged" bit section above.コマンドはcore.ignorestat構成変数を調べます。上記の「変更しない」ビットセクションの使用を参照してください。

The command also looks at core.trustctime configuration variable. It can be useful when the inode change time is regularly modified by something outside Git (file system crawlers and backup systems use ctime for marking files processed) (see git-config[1]).このコマンドはcore.trustctime構成変数も調べます。inodeの変更時刻がGit以外のものによって定期的に変更される場合(ファイルシステムクローラとバックアップシステムは処理されたファイルのマーク付けにctimeを使用します)(git-config [1]を参照)に役立ちます。

The untracked cache extension can be enabled by the core.untrackedCache configuration variable (see git-config[1]).追跡されていないキャッシュ拡張はcore.untrackedCache設定変数で有効にできます(git-config [1]を参照)。

SEE ALSO関連項目

git-config[1], git-add[1], git-ls-files[1]git-config [1]git-add [1]git-ls-files [1]

GIT

Part of the git[1] suite一部のgit [1]スイート

関連記事

スポンサーリンク

RAND関数 乱数を求める

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る