Skip to content

Commit ce02ecd

Browse files
authored
ch-10: avoid unnecessary mention update-index's --add
The book clearly mentions that --add needs to be passed to 'git update-index' only when the file is new to the index. When the second version of 'test.txt' is added, the index know about the file already. So, avoid passing the '--add' when adding the second version of 'test.txt'
1 parent 8a81047 commit ce02ecd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/10-git-internals/sections/objects.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ You'll now create a new tree with the second version of `test.txt` and a new fil
202202
[source,console]
203203
----
204204
$ echo 'new file' > new.txt
205-
$ git update-index --add --cacheinfo 100644 \
205+
$ git update-index --cacheinfo 100644 \
206206
1f7a7a472abf3dd9643fd615f6da379c4acb3e3a test.txt
207207
$ git update-index --add new.txt
208208
----

0 commit comments

Comments
 (0)