@@ -235,10 +235,10 @@ Then, you specify the mode, SHA-1, and filename:
235
235
自前でツリーを作るのも非常に簡単です。
236
236
Gitは通常、ステージングエリアやインデックスの状態を取得してツリーを作成し、そのツリーをもとに一連のツリーオブジェクトを書き込みます。
237
237
そのため、ツリーオブジェクトを作るには、まずファイルをステージングしてインデックスを作成しなければなりません。
238
- 単一のエントリー – ここでは`test.txt`ファイルの最初のバージョン – からインデックスを作るには、`update-index` という配管コマンドを使います。
239
- このコマンドは、前のバージョンの`test.txt`ファイルをあえて新しいステージングエリアに追加する際に使用します。
238
+ 単一のエントリー – ここでは `test.txt` ファイルの最初のバージョン – からインデックスを作るには、`update-index` という配管コマンドを使います。
239
+ このコマンドは、前のバージョンの `test.txt` ファイルをあえて新しいステージングエリアに追加する際に使用します。
240
240
ファイルはまだステージングエリアには存在しない(まだステージングエリアをセットアップさえしていない)ので、`--add` オプションを付けなければなりません。
241
- また、追加しようとしているファイルはディレクトリには無くデータベースにあるので、`--cacheinfo`オプションを付ける必要があります。
241
+ また、追加しようとしているファイルはディレクトリには無くデータベースにあるので、`--cacheinfo` オプションを付ける必要があります。
242
242
その次に、モード、SHA-1、ファイル名を指定します。
243
243
244
244
[source,console]
285
285
//////////////////////////
286
286
You'll now create a new tree with the second version of `test.txt` and a new file as well:
287
287
//////////////////////////
288
- 今度は、2つめのバージョンの`test.txt`と、新規作成したファイルから、新しくツリーを作ります。
288
+ 今度は、2つめのバージョンの `test.txt` と、新規作成したファイルから、新しくツリーを作ります。
289
289
290
290
[source,console]
291
291
----
@@ -298,7 +298,7 @@ $ git update-index --add new.txt
298
298
Your staging area now has the new version of `test.txt` as well as the new file `new.txt`.
299
299
Write out that tree (recording the state of the staging area or index to a tree object) and see what it looks like:
300
300
//////////////////////////
301
- これでステージングエリアには、`new.txt`という新しいファイルに加えて、新しいバージョンの`test.txt`も登録されました。
301
+ これでステージングエリアには、 `new.txt` という新しいファイルに加えて、新しいバージョンの `test.txt` も登録されました。
302
302
このツリーを書き出して(ステージングエリアまたはインデックスの状態をツリーオブジェクトとして記録して)、どのようになったか見てみましょう。
303
303
304
304
[source,console]
@@ -311,12 +311,12 @@ $ git cat-file -p 0155eb4229851634a0f03eb265b69f5a2d56f341
311
311
----
312
312
313
313
//////////////////////////
314
- Notice that this tree has both file entries and also that the `test.txt` SHA-1 is the `` version 2'' SHA-1 from earlier (`1f7a7a`).
314
+ Notice that this tree has both file entries and also that the `test.txt` SHA-1 is the "` version 2`" SHA-1 from earlier (`1f7a7a`).
315
315
Just for fun, you'll add the first tree as a subdirectory into this one.
316
316
You can read trees into your staging area by calling `read-tree`.
317
317
In this case, you can read an existing tree into your staging area as a subtree by using the `--prefix` option to `read-tree`:
318
318
//////////////////////////
319
- このツリーに両方のファイルエントリがあること、また、`test.txt`のSHA-1が先ほどの `` version 2'' のSHA-1(`1f7a7a`)であることに注意してください。
319
+ このツリーに両方のファイルエントリがあること、また、`test.txt` のSHA-1が先ほどの "` version 2`" のSHA-1( `1f7a7a` )であることに注意してください。
320
320
ちょっと試しに、最初のツリーをサブディレクトリとしてこの中に追加してみましょう。
321
321
`read-tree` を呼ぶことで、ステージングエリアの中にツリーを読み込むことができます。
322
322
このケースでは、`--prefix` オプションを付けて `read-tree` コマンドを使用することで、ステージングエリアの中に、既存のツリーをサブツリーとして読み込むことができます。
@@ -336,7 +336,7 @@ $ git cat-file -p 3c4e9cd789d88d8d89c1073707c3585e41b0e614
336
336
If you created a working directory from the new tree you just wrote, you would get the two files in the top level of the working directory and a subdirectory named `bak` that contained the first version of the `test.txt` file.
337
337
You can think of the data that Git contains for these structures as being like this:
338
338
//////////////////////////
339
- 先ほど書き込んだ新しいツリーから作業ディレクトリを作っていれば、作業ディレクトリの直下にファイルが2つと、最初のバージョンの`test.txt`ファイルが含まれている `bak` という名前のサブディレクトリが入ります。
339
+ 先ほど書き込んだ新しいツリーから作業ディレクトリを作っていれば、作業ディレクトリの直下にファイルが2つと、最初のバージョンの `test.txt` ファイルが含まれている `bak` という名前のサブディレクトリが入ります。
340
340
このような構成に対し、Gitが格納するデータのイメージは次のようになります。
341
341
342
342
//////////////////////////
0 commit comments