read-tree

NAME

git-read-tree - Reads tree information into the indexgit-read-tree - ツリー情報をインデックスに読み込む

SYNOPSIS概要

git read-tree [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>]
		[-u [--exclude-per-directory=<gitignore>] | -i]]
		[--index-output=<file>] [--no-sparse-checkout]
		(--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])

DESCRIPTION説明

Reads the tree information given by <tree-ish> into the index, but does not actually update any of the files it "caches". (see: git-checkout-index[1])<tree-ish>で与えられたツリー情報をインデックスに読み込みますが、実際にはそれが "キャッシュする"ファイルを更新することはありません。(参照:git-checkout-index [1]

Optionally, it can merge a tree into the index, perform a fast-forward (i.e. 2-way) merge, or a 3-way merge, with the -m flag. When used with -m, the -u flag causes it to also update the files in the work tree with the result of the merge.必要に応じて、-mフラグを使用してツリーをインデックスにマージしたり、早送り(2方向)マージ、または3方向マージを実行したりできます。このフラグを一緒-mに使用すると、-uマージの結果でワークツリー内のファイルも更新されます。

Trivial merges are done by git read-tree itself. Only conflicting paths will be in unmerged state when git read-tree returns.自明なマージはgit read-tree自体によって行われます。git read-treeが戻ったとき、衝突しているパスだけがマージされていない状態になります。

OPTIONSオプション

-m

Perform a merge, not just a read. The command will refuse to run if your index file has unmerged entries, indicating that you have not finished previous merge you started.単なる読み取りではなく、マージを実行してください。インデックスファイルにマージされていないエントリがある場合、コマンドは実行を拒否されます。これは、以前に開始したマージを終了していないことを示します。

--reset

Same as -m, except that unmerged entries are discarded instead of failing.マージされていないエントリが失敗せずに破棄されることを除いて、-mと同じです。

-u

After a successful merge, update the files in the work tree with the result of the merge.マージが成功したら、マージの結果でワークツリー内のファイルを更新します。

-i -私

Usually a merge requires the index file as well as the files in the working tree to be up to date with the current head commit, in order not to lose local changes. This flag disables the check with the working tree and is meant to be used when creating a merge of trees that are not directly related to the current working tree status into a temporary index file.通常のマージでは、ローカルの変更を失わないようにするために、インデックスファイルと作業ツリー内のファイルを現在のヘッドコミットに合わせて最新の状態にする必要があります。このフラグは、作業ツリーとのチェックを無効にし、現在の作業ツリーのステータスに直接関連しないツリーのマージを一時インデックスファイルに作成するときに使用されることを意図しています。

-n
--dry-run

Check if the command would error out, without updating the index or the files in the working tree for real.作業ツリーのインデックスまたはファイルを実際に更新せずに、コマンドがエラーになるかどうかを確認します。

-v

Show the progress of checking files out.ファイルのチェックアウトの進行状況を表示します。

--trivial - 自明

Restrict three-way merge by git read-tree to happen only if there is no file-level merging required, instead of resolving merge for trivial cases and leaving conflicting files unresolved in the index.些細なケースではマージを解決し、競合するファイルをインデックス内で未解決のままにするのではなく、ファイルレベルでのマージが不要な場合にのみ、git read-treeによる3方向マージを制限します。

--aggressive - 積極的

Usually a three-way merge by git read-tree resolves the merge for really trivial cases and leaves other cases unresolved in the index, so that porcelains can implement different merge policies. This flag makes the command resolve a few more cases internally:通常、git read-treeによる3者間マージは、本当に些細なケースのマージを解決し、他のケースは未解決のままインデックスに残すため、磁器はさまざまなマージポリシーを実装できます。このフラグにより??、コマンドは内部でさらにいくつかのケースを解決します。

  • when one side removes a path and the other side leaves the path unmodified. The resolution is to remove that path.片側でパスが削除され、もう一方の側でパスが変更されないままの場合。解決策はそのパスを削除することです。

  • when both sides remove a path. The resolution is to remove that path.両側がパスを削除したとき。解決策はそのパスを削除することです。

  • when both sides add a path identically. The resolution is to add that path.両側が同じようにパスを追加するとき。解決策はそのパスを追加することです。

--prefix=<prefix> --prefix = <prefix>

Keep the current index contents, and read the contents of the named tree-ish under the directory at <prefix>. The command will refuse to overwrite entries that already existed in the original index file.現在のインデックスの内容を保持し、ディレクトリatの下にある名前付きのtree-ishの内容を読み取ります<prefix>。このコマンドは、元のインデックスファイルにすでに存在していたエントリを上書きすることを拒否します。

--exclude-per-directory=<gitignore> --exclude-per-directory = <gitignore>

When running the command with -u and -m options, the merge result may need to overwrite paths that are not tracked in the current branch. The command usually refuses to proceed with the merge to avoid losing such a path. However this safety valve sometimes gets in the way. For example, it often happens that the other branch added a file that used to be a generated file in your branch, and the safety valve triggers when you try to switch to that branch after you ran make but before running make clean to remove the generated file. This option tells the command to read per-directory exclude file (usually .gitignore) and allows such an untracked but explicitly ignored file to be overwritten.-u-mオプションを指定してコマンドを実行すると、現在のブランチで追跡されていないパスをマージ結果で上書きする必要があります。このようなパスを失うことを避けるために、コマンドは通常マージを続行することを拒否します。しかしこの安全弁は時々邪魔をする。たとえば、他のブランチがブランチに生成されたファイルであったファイルを追加し、実行後、生成されたファイルを削除するためmakeに実行make cleanする前にそのブランチに切り替えようとすると、安全弁が作動します。このオプションは、ディレクトリごとの除外ファイル(通常は.gitignore)を読み取るようにコマンドに指示し、そのような追跡されていないが明示的に無視されたファイルを上書きすることを可能にします。

--index-output=<file> --index-output = <ファイル>

Instead of writing the results out to $GIT_INDEX_FILE, write the resulting index in the named file. While the command is operating, the original index file is locked with the same mechanism as usual. The file must allow to be rename(2)ed into from a temporary file that is created next to the usual index file; typically this means it needs to be on the same filesystem as the index file itself, and you need write permission to the directories the index file and index output file are located in.結果を書き出す代わりに$GIT_INDEX_FILE、結果のインデックスを指定されたファイルに書き出します。コマンドが動作している間、元のインデックスファイルは通常と同じメカニズムでロックされます。ファイルは、通常のインデックスファイルの隣に作成された一時ファイルから名前変更(2)できるようにする必要があります。通常、これはインデックスファイルと同じファイルシステム上に存在する必要があり、インデックスファイルとインデックス出力ファイルがあるディレクトリへの書き込み権限が必要です。

--[no-]recurse-submodules - [no-] recurse-submodules

Using --recurse-submodules will update the content of all initialized submodules according to the commit recorded in the superproject by calling read-tree recursively, also setting the submodules HEAD to be detached at that commit.--recurse-submodulesを使用すると、read-treeを再帰的に呼び出すことでスーパープロジェクトに記録されたコミットに従って、初期化されたすべてのサブモジュールの内容を更新し、そのコミットでサブモジュールHEADを切り離します。

--no-sparse-checkout

Disable sparse checkout support even if core.sparseCheckout is true.core.sparseCheckouttrueの場合でもスパースチェックアウトサポートを無効にします。

--empty - 空の

Instead of reading tree object(s) into the index, just empty it.ツリーオブジェクトをインデックスに読み込む代わりに、単に空にします。

<tree-ish#> <tree-ish#>

The id of the tree object(s) to be read/merged.読み取り/マージされるツリーオブジェクトのID。

MERGINGマージ

If -m is specified, git read-tree can perform 3 kinds of merge, a single tree merge if only 1 tree is given, a fast-forward merge with 2 trees, or a 3-way merge if 3 or more trees are provided.これ-mが指定された場合、git read-treeは3種類のマージ、1つのツリーしか与えられない場合はシングルツリーマージ、2つのツリーを含む早送りマージ、3つ以上のツリーが与えられる場合は3方向マージを実行できます。

Single Tree Mergeシングルツリーマージ

If only 1 tree is specified, git read-tree operates as if the user did not specify -m, except that if the original index has an entry for a given pathname, and the contents of the path match with the tree being read, the stat info from the index is used. (In other words, the index’s stat()s take precedence over the merged tree’s).ツリーが1つしか指定されていない場合、git read-treeはユーザが指定していない場合と同じように動作します-m。ただし、元のインデックスに特定のパス名のエントリがあり、パスの内容が読み込まれるツリーと一致する場合は異なります。インデックスからが使用されます。(つまり、インデックスのstat()がマージされたツリーよりも優先されます)。

That means that if you do a git read-tree -m <newtree> followed by a git checkout-index -f -u -a, the git checkout-index only checks out the stuff that really changed.つまり、git read-tree -m <newtree>続けてa を実行するgit checkout-index -f -u -aと、git checkout-indexは実際に変更されたものだけをチェックアウトします。

This is used to avoid unnecessary false hits when git diff-files is run after git read-tree.これはgit read-treeの後にgit diff-filesが実行されるときに不必要な誤ったヒットを避けるために使われます

Two Tree Merge2本の木の併合

Typically, this is invoked as git read-tree -m $H $M, where $H is the head commit of the current repository, and $M is the head of a foreign tree, which is simply ahead of $H (i.e. we are in a fast-forward situation).通常、これは次のように呼び出されますgit read-tree -m $H $M。ここで、$ Hは現在のリポジトリのヘッドコミットであり、$ Mは外部ツリーのヘッドで、$ Hよりも単純です(つまり、早送りの状況にあります)。

When two trees are specified, the user is telling git read-tree the following:2つのツリーが指定されている場合、ユーザーはgit read-treeに次のことを伝えています。

  1. The current index and work tree is derived from $H, but the user may have local changes in them since $H.現在のインデックスと作業ツリーは$ Hから派生していますが、ユーザーは$ H以降にローカルの変更を加えることができます。

  2. The user wants to fast-forward to $M.ユーザーは$ Mに早送りしたいです。

In this case, the git read-tree -m $H $M command makes sure that no local change is lost as the result of this "merge". Here are the "carry forward" rules, where "I" denotes the index, "clean" means that index and work tree coincide, and "exists"/"nothing" refer to the presence of a path in the specified commit:この場合、git read-tree -m $H $Mコマンドはこの「マージ」の結果としてローカルの変更が失われないようにします。これは "繰り越し"規則です。 "I"はインデックスを表し、 "clean"はインデックスと作業ツリーが一致することを意味し、 "exists" / "nothing"は指定されたコミットにパスが存在することを表します。

	I                   H        M        Result
       -------------------------------------------------------
     0  nothing             nothing  nothing  (does not happen)
     1  nothing             nothing  exists   use M
     2  nothing             exists   nothing  remove path from index
     3  nothing             exists   exists,  use M if "initial checkout",
				     H == M   keep index otherwise
				     exists,  fail
				     H != M
        clean I==H  I==M
       ------------------
     4  yes   N/A   N/A     nothing  nothing  keep index
     5  no    N/A   N/A     nothing  nothing  keep index
     6  yes   N/A   yes     nothing  exists   keep index
     7  no    N/A   yes     nothing  exists   keep index
     8  yes   N/A   no      nothing  exists   fail
     9  no    N/A   no      nothing  exists   fail
     10 yes   yes   N/A     exists   nothing  remove path from index
     11 no    yes   N/A     exists   nothing  fail
     12 yes   no    N/A     exists   nothing  fail
     13 no    no    N/A     exists   nothing  fail
	clean (H==M)
       ------
     14 yes                 exists   exists   keep index
     15 no                  exists   exists   keep index
        clean I==H  I==M (H!=M)
       ------------------
     16 yes   no    no      exists   exists   fail
     17 no    no    no      exists   exists   fail
     18 yes   no    yes     exists   exists   keep index
     19 no    no    yes     exists   exists   keep index
     20 yes   yes   no      exists   exists   use M
     21 no    yes   no      exists   exists   fail

In all "keep index" cases, the index entry stays as in the original index file. If the entry is not up to date, git read-tree keeps the copy in the work tree intact when operating under the -u flag.すべての "インデックス保持"の場合、インデックスエントリは元のインデックスファイルと同じままです。エントリが最新ではない場合、git read-treeは、-uフラグのもとで動作しているときに、作業ツリー内のコピーをそのまま保持します。

When this form of git read-tree returns successfully, you can see which of the "local changes" that you made were carried forward by running git diff-index --cached $M. Note that this does not necessarily match what git diff-index --cached $H would have produced before such a two tree merge. This is because of cases 18 and 19 --- if you already had the changes in $M (e.g. maybe you picked it up via e-mail in a patch form), git diff-index --cached $H would have told you about the change before this merge, but it would not show in git diff-index --cached $M output after the two-tree merge.この形式のgit read-treeが正常に終了したら、実行した「ローカルの変更」のうちどれが繰り越されたのかを確認できますgit diff-index --cached $M。これは、そのgit diff-index --cached $Hような2ツリーマージの前に生成されたものと必ずしも一致しないことに注意してください。これはケース18と19のためです---もしあなたが既に$ Mの変更をしていたなら(例えばパッチフォームで電子メールでそれを拾ったのgit diff-index --cached $Hなら)、このマージの前に変更についてあなたに言ったでしょうがgit diff-index --cached $M2ツリーマージ後は出力に表示されません。

Case 3 is slightly tricky and needs explanation. The result from this rule logically should be to remove the path if the user staged the removal of the path and then switching to a new branch. That however will prevent the initial checkout from happening, so the rule is modified to use M (new tree) only when the content of the index is empty. Otherwise the removal of the path is kept as long as $H and $M are the same.ケース3はややトリッキーで説明が必要です。この規則の結果、論理的には、ユーザーがパスの削除をステージングしてから新しいブランチに切り替えると、パスが削除されます。ただし、最初のチェックアウトが行われないようにするため、インデックスの内容が空の場合にのみM(新しいツリー)を使用するように規則が変更されます。それ以外の場合、パスの削除は$ Hと$ Mが同じである限り保持されます。

3-Way Merge3者間マージ

Each "index" entry has two bits worth of "stage" state. stage 0 is the normal one, and is the only one you’d see in any kind of normal use.各「インデックス」エントリは2ビット分の「ステージ」状態を有する。ステージ0は通常のものであり、通常の使用で見られる唯一のものです。

However, when you do git read-tree with three trees, the "stage" starts out at 1.しかし、3つのツリーread-treegitすると、 "stage"は1から始まります。

This means that you can doこれはあなたができることを意味します

$ git read-tree -m <tree1> <tree2> <tree3>

and you will end up with an index with all of the <tree1> entries in "stage1", all of the <tree2> entries in "stage2" and all of the <tree3> entries in "stage3". When performing a merge of another branch into the current branch, we use the common ancestor tree as <tree1>, the current branch head as <tree2>, and the other branch head as <tree3>.そして、 "stage1"のすべての<tree1>エントリ、 "stage2"のすべての<tree2>エントリ、および "stage3"のすべての<tree3>エントリを含むインデックスになります。現在のブランチへの別のブランチのマージを実行するときは、共通の先祖ツリーを<tree1>として、現在のブランチヘッドを<tree2>として、そして他のブランチヘッドを<tree3>として使います。

Furthermore, git read-tree has special-case logic that says: if you see a file that matches in all respects in the following states, it "collapses" back to "stage0":さらに、git read-treeには以下のような特別な場合のロジックがあります。以下の状態ですべての点で一致するファイルが見つかった場合、それは「折りたたまれて」「stage0」に戻ります。

  • stage 2 and 3 are the same; take one or the other (it makes no difference - the same work has been done on our branch in stage 2 and their branch in stage 3)ステージ2と3は同じです。どちらかを選択してください(違いはありません。ステージ2のブランチとステージ3のブランチで同じ作業が行われています)。

  • stage 1 and stage 2 are the same and stage 3 is different; take stage 3 (our branch in stage 2 did not do anything since the ancestor in stage 1 while their branch in stage 3 worked on it)ステージ1とステージ2は同じで、ステージ3は異なります。ステージ3を取る(ステージ2のブランチはステージ1の祖先から何もしませんでしたが、ステージ3のブランチはそれを処理しました)

  • stage 1 and stage 3 are the same and stage 2 is different take stage 2 (we did something while they did nothing)ステージ1とステージ3は同じでステージ2は違うステージ2を取る(彼らは何もしないうちに何かをした)

The git write-tree command refuses to write a nonsensical tree, and it will complain about unmerged entries if it sees a single entry that is not stage 0.gitの書き込みツリーコマンドは、無意味な木を書くことを拒否し、それがステージ0ではない単一のエントリを見ればそれがマージされていないエントリが文句を言うでしょう。

OK, this all sounds like a collection of totally nonsensical rules, but it’s actually exactly what you want in order to do a fast merge. The different stages represent the "result tree" (stage 0, aka "merged"), the original tree (stage 1, aka "orig"), and the two trees you are trying to merge (stage 2 and 3 respectively).わかりました、これはまったく無意味なルールの集まりのようですが、実際には高速マージを実行するために必要なものです。異なるステージは「結果ツリー」(ステージ0、別名「マージ」)、元のツリー(ステージ1、別名「orig」)、およびマージしようとしている2つのツリー(それぞれステージ2と3)を表します。

The order of stages 1, 2 and 3 (hence the order of three <tree-ish> command-line arguments) are significant when you start a 3-way merge with an index file that is already populated. Here is an outline of how the algorithm works:ステージ1、2、3の順序(したがって3つの<tree-ish>コマンドライン引数の順序)は、既に作成されているインデックスファイルとの3方向マージを開始するときに重要になります。これがアルゴリズムのしくみの概要です。

  • if a file exists in identical format in all three trees, it will automatically collapse to "merged" state by git read-tree.ファイルが3つのツリーすべてに同じフォーマットで存在する場合は、git read-treeによって自動的に「マージ」状態に折りたたまれます

  • a file that has any difference what-so-ever in the three trees will stay as separate entries in the index. It’s up to "porcelain policy" to determine how to remove the non-0 stages, and insert a merged version.3つのツリーでまったく違いがあるファイルは、インデックス内の個別のエントリとして残ります。0以外のステージを削除してマージバージョンを挿入する方法を決定するのは、「磁器ポリシー」次第です。

  • the index file saves and restores with all this information, so you can merge things incrementally, but as long as it has entries in stages 1/2/3 (i.e., "unmerged entries") you can’t write the result. So now the merge algorithm ends up being really simple:インデックスファイルはこれらすべての情報を使って保存および復元されるので、段階的にマージすることはできますが、ステージ1/2/3のエントリ(つまり「未マージエントリ」)がある限り、結果を書き込むことはできません。したがって、マージアルゴリズムは非常に単純になります。

    • you walk the index in order, and ignore all entries of stage 0, since they’ve already been done.インデックスを順番に見ていき、ステージ0のすべてのエントリは無視されています。

    • if you find a "stage1", but no matching "stage2" or "stage3", you know it’s been removed from both trees (it only existed in the original tree), and you remove that entry."stage1"を見つけたが、一致する "stage2"または "stage3"が見つからなかった場合は、両方のツリーから削除されたことがわかり(元のツリーにのみ存在)、そのエントリを削除します。

    • if you find a matching "stage2" and "stage3" tree, you remove one of them, and turn the other into a "stage0" entry. Remove any matching "stage1" entry if it exists too. .. all the normal trivial rules ..一致する "stage2"と "stage3"のツリーが見つかった場合は、どちらか一方を削除し、もう一方を "stage0"エントリに変換します。一致する "stage1"エントリが存在する場合はそれも削除します。..すべての通常の些細なルール..

You would normally use git merge-index with supplied git merge-one-file to do this last step. The script updates the files in the working tree as it merges each path and at the end of a successful merge.この最後のステップを実行するには、通常、git merge-indexと提供されているgit merge-one-fileを使用します。スクリプトは、各パスをマージするとき、および正常にマージされたときに、作業ツリー内のファイルを更新します。

When you start a 3-way merge with an index file that is already populated, it is assumed that it represents the state of the files in your work tree, and you can even have files with changes unrecorded in the index file. It is further assumed that this state is "derived" from the stage 2 tree. The 3-way merge refuses to run if it finds an entry in the original index file that does not match stage 2.すでに生成されているインデックスファイルを使用して3者間マージを開始すると、それは作業ツリー内のファイルの状態を表していると見なされます。また、変更が記録されていないファイルもインデックスファイルに記録できます。さらに、この状態はステージ2ツリーから「派生」していると想定されます。ステージ2と一致しないエントリが元のインデックスファイルに見つかった場合、3-wayマージは実行を拒否します。

This is done to prevent you from losing your work-in-progress changes, and mixing your random changes in an unrelated merge commit. To illustrate, suppose you start from what has been committed last to your repository:これは、進行中の変更を失うことや、無関係のマージコミットにランダムな変更を混在させることを防ぐために行われます。説明のために、リポジトリに最後にコミットされたものから始めるとします。

$ JC=`git rev-parse --verify "HEAD^0"`
$ git checkout-index -f -u -a $JC

You do random edits, without running git update-index. And then you notice that the tip of your "upstream" tree has advanced since you pulled from him:git update-indexを実行せずに、ランダムに編集します。そして、あなたはあなたが彼から引っ張ってからあなたの "上流の"木の先端が進んだことに気づくでしょう:

$ git fetch git://.... linus
$ LT=`git rev-parse FETCH_HEAD`

Your work tree is still based on your HEAD ($JC), but you have some edits since. Three-way merge makes sure that you have not added or modified index entries since $JC, and if you haven’t, then does the right thing. So with the following sequence:あなたの作業ツリーはまだあなたのHEAD($ JC)に基づいていますが、それ以来いくつかの編集があります。3者間マージでは、$ JC以降にインデックスエントリを追加または変更していないことを確認します。まだ行っていない場合は、正しいことを行います。それで、次のシーケンスで:

$ git read-tree -m -u `git merge-base $JC $LT` $JC $LT
$ git merge-index git-merge-one-file -a
$ echo "Merge with Linus" | \
  git commit-tree `git write-tree` -p $JC -p $LT

what you would commit is a pure merge between $JC and $LT without your work-in-progress changes, and your work tree would be updated to the result of the merge.作業中に変更を加えずにコミットするのは$ JCと$ LTの間の純粋なマージであり、作業ツリーはマージの結果に合わせて更新されます。

However, if you have local changes in the working tree that would be overwritten by this merge, git read-tree will refuse to run to prevent your changes from being lost.しかし、このマージによって上書きされるような作業ツリーのローカルな変更があった場合、git read-treeは変更が失われないように実行を拒否します。

In other words, there is no need to worry about what exists only in the working tree. When you have local changes in a part of the project that is not involved in the merge, your changes do not interfere with the merge, and are kept intact. When they do interfere, the merge does not even start (git read-tree complains loudly and fails without modifying anything). In such a case, you can simply continue doing what you were in the middle of doing, and when your working tree is ready (i.e. you have finished your work-in-progress), attempt the merge again.言い換えれば、作業ツリーにのみ存在するものについて心配する必要はありません。マージに関与していないプロジェクトの一部にローカルの変更があっても、その変更はマージを妨げず、そのまま残ります。彼らはときに行う干渉し、マージにも(起動しないのgit読み取り木は大声で不平を言うと、何も変更せずに失敗しました)。そのような場合は、作業中の作業を続行し、作業ツリーの準備ができたら(つまり、作業中の作業が終了したら)、もう一度マージを試行します。

SPARSE CHECKOUTスパースチェックアウト

"Sparse checkout" allows populating the working directory sparsely. It uses the skip-worktree bit (see git-update-index[1]) to tell Git whether a file in the working directory is worth looking at.「スパースチェックアウト」は、作業ディレクトリにスパースでデータを投入することを可能にします。これは、作業ディレクトリのファイルが一見の価値があるかどうかをGitに伝えるために、skip-worktreeビット(git-update-index [1]を参照)を使用します。

git read-tree and other merge-based commands (git merge, git checkout…​) can help maintaining the skip-worktree bitmap and working directory update. $GIT_DIR/info/sparse-checkout is used to define the skip-worktree reference bitmap. When git read-tree needs to update the working directory, it resets the skip-worktree bit in the index based on this file, which uses the same syntax as .gitignore files. If an entry matches a pattern in this file, skip-worktree will not be set on that entry. Otherwise, skip-worktree will be set.git read-treeや他のマージベースのコマンド(git mergegit checkoutなど)は、skip-worktreeビットマップと作業ディレクトリの更新を維持するのに役立ちます。$GIT_DIR/info/sparse-checkoutスキップ作業ツリー参照ビットマップを定義するために使用されます。git read-treeが作業ディレクトリを更新する必要がある場合、このファイルに基づいてインデックスのskip-worktreeビットをリセットします。これは.gitignoreファイルと同じ構文を使用します。エントリがこのファイルのパターンと一致すると、そのエントリにskip-worktreeは設定されません。そうでなければ、skip-worktreeが設定されます。

Then it compares the new skip-worktree value with the previous one. If skip-worktree turns from set to unset, it will add the corresponding file back. If it turns from unset to set, that file will be removed.次に、新しいskip-worktree値を前の値と比較します。skip-worktreeがsetからunsetに変わると、対応するファイルが追加されます。未設定から設定に変わると、そのファイルは削除されます。

While $GIT_DIR/info/sparse-checkout is usually used to specify what files are in, you can also specify what files are not in, using negate patterns. For example, to remove the file unwanted:一方で$GIT_DIR/info/sparse-checkout、通常のファイルがであるかを指定するために使用され、あなたはまた、ファイルが何であるかを指定することができません否定パターンを使用して、インチ たとえば、ファイルを削除するにはunwanted

/*
!unwanted

Another tricky thing is fully repopulating the working directory when you no longer want sparse checkout. You cannot just disable "sparse checkout" because skip-worktree bits are still in the index and your working directory is still sparsely populated. You should re-populate the working directory with the $GIT_DIR/info/sparse-checkout file content as follows:もう1つの注意が必要なのは、スパースチェックアウトが不要になったときに作業ディレクトリを完全に再作成することです。skip-worktreeビットがまだインデックス内にあり、作業ディレクトリがまだまばらに移入されているため、単に "sparse checkout"を無効にすることはできません。$GIT_DIR/info/sparse-checkout次のように作業ディレクトリにファイルの内容を再設定する必要があります。

/*

Then you can disable sparse checkout. Sparse checkout support in git read-tree and similar commands is disabled by default. You need to turn core.sparseCheckout on in order to have sparse checkout support.その後、疎チェックアウトを無効にできます。git read-treeと同様のコマンドでの疎チェックアウトのサポートはデフォルトで無効になっています。あなたcore.sparseCheckoutはまばらなチェックアウトをサポートするためにオンにする必要があります。

SEE ALSO関連項目

git-write-tree[1]; git-ls-files[1]; gitignore[5]git-write-tree [1] ; git-ls-files [1] ; ジチニョーレ[5]

GIT

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

関連記事

スポンサーリンク

Header - ページヘッダ

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

上に戻る