X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=Documentation%2Fgittutorial-2.txt;h=e00a4d21709118ef352bd02538e28569f00b738d;hb=514a529d253d263672e5a855775382608f7fdfc1;hp=dc8fc3a18a5e613da910c6bd5a1dda9c85c3f5b1;hpb=77f143bf3e218857ec8e5244d7e862e8e0c1a041;p=git.git diff --git a/Documentation/gittutorial-2.txt b/Documentation/gittutorial-2.txt index dc8fc3a18..e00a4d217 100644 --- a/Documentation/gittutorial-2.txt +++ b/Documentation/gittutorial-2.txt @@ -7,6 +7,7 @@ gittutorial-2 - A tutorial introduction to git: part two SYNOPSIS -------- +[verse] git * DESCRIPTION @@ -33,12 +34,12 @@ $ echo 'hello world' > file.txt $ git add . $ git commit -a -m "initial commit" [master (root-commit) 54196cc] initial commit - 1 files changed, 1 insertions(+), 0 deletions(-) + 1 file changed, 1 insertion(+) create mode 100644 file.txt $ echo 'hello world!' >file.txt $ git commit -a -m "add emphasis" [master c4d59f3] add emphasis - 1 files changed, 1 insertions(+), 1 deletions(-) + 1 file changed, 1 insertion(+), 1 deletion(-) ------------------------------------------------ What are the 7 digits of hex that git responded to the commit with? @@ -260,7 +261,7 @@ index a042389..513feba 100644 +hello world, again ------------------------------------------------ -So 'git-diff' is comparing against something other than the head. +So 'git diff' is comparing against something other than the head. The thing that it's comparing against is actually the index file, which is stored in .git/index in a binary format, but whose contents we can examine with ls-files: @@ -275,9 +276,9 @@ hello world! hello world, again ------------------------------------------------ -So what our 'git-add' did was store a new blob and then put +So what our 'git add' did was store a new blob and then put a reference to it in the index file. If we modify the file again, -we'll see that the new modifications are reflected in the 'git-diff' +we'll see that the new modifications are reflected in the 'git diff' output: ------------------------------------------------ @@ -292,7 +293,7 @@ index 513feba..ba3da7b 100644 +again? ------------------------------------------------ -With the right arguments, 'git-diff' can also show us the difference +With the right arguments, 'git diff' can also show us the difference between the working directory and the last commit, or between the index and the last commit: @@ -316,7 +317,7 @@ index a042389..513feba 100644 +hello world, again ------------------------------------------------ -At any time, we can create a new commit using 'git-commit' (without +At any time, we can create a new commit using 'git commit' (without the "-a" option), and verify that the state committed only includes the changes stored in the index file, not the additional change that is still only in our working tree: @@ -334,11 +335,11 @@ index 513feba..ba3da7b 100644 +again? ------------------------------------------------ -So by default 'git-commit' uses the index to create the commit, not +So by default 'git commit' uses the index to create the commit, not the working tree; the "-a" option to commit tells it to first update the index with all changes in the working tree. -Finally, it's worth looking at the effect of 'git-add' on the index +Finally, it's worth looking at the effect of 'git add' on the index file: ------------------------------------------------ @@ -346,7 +347,7 @@ $ echo "goodbye, world" >closing.txt $ git add closing.txt ------------------------------------------------ -The effect of the 'git-add' was to add one entry to the index file: +The effect of the 'git add' was to add one entry to the index file: ------------------------------------------------ $ git ls-files --stage @@ -373,7 +374,7 @@ $ git status # # new file: closing.txt # -# Changed but not updated: +# Changes not staged for commit: # (use "git add ..." to update what will be committed) # # modified: file.txt