diff --git a/book/08-customizing-git/sections/config.asc b/book/08-customizing-git/sections/config.asc index 9fc1794d7..80407cf7d 100644 --- a/book/08-customizing-git/sections/config.asc +++ b/book/08-customizing-git/sections/config.asc @@ -145,7 +145,7 @@ You can put patterns in your project's `.gitignore` file to have Git not see the But sometimes you want to ignore certain files for all repositories that you work with. If your computer is running Mac OS X, you're probably familiar with `.DS_Store` files. -If your preferred editor is Emacs or Vim, you know about files that end with a `~`. +If your preferred editor is Emacs or Vim, you know about files that end with a `~` or `.swp`. This setting lets you write a kind of global `.gitignore` file. If you create a `~/.gitignore_global` file with these contents: @@ -153,6 +153,7 @@ If you create a `~/.gitignore_global` file with these contents: [source,ini] ---- *~ +.*.swp .DS_Store ---- diff --git a/book/09-git-and-other-scms/sections/import-tfs.asc b/book/09-git-and-other-scms/sections/import-tfs.asc index a0064d04e..68a7f4cf9 100644 --- a/book/09-git-and-other-scms/sections/import-tfs.asc +++ b/book/09-git-and-other-scms/sections/import-tfs.asc @@ -25,12 +25,12 @@ Open the file and find at which characters start and end the column and replace, [source,powershell] ---- -PS> cat AUTHORS_TMP | cut -b 11-20 | tail -n+3 | uniq | sort > AUTHORS +PS> cat AUTHORS_TMP | cut -b 11-20 | tail -n+3 | sort | uniq > AUTHORS ---- The `cut` command keeps only the characters between 11 and 20 from each line. The `tail` command skips the first two lines, which are field headers and ASCII-art underlines. -The result of all of this is piped to `uniq` to eliminate duplicates, and saved to a file named `AUTHORS`. +The result of all of this is piped to `sort` and `uniq` to eliminate duplicates, and saved to a file named `AUTHORS`. The next step is manual; in order for git-tfs to make effective use of this file, each line must be in this format: [source,text] diff --git a/book/10-git-internals/sections/objects.asc b/book/10-git-internals/sections/objects.asc index 1c9a1858f..e372ebf56 100644 --- a/book/10-git-internals/sections/objects.asc +++ b/book/10-git-internals/sections/objects.asc @@ -242,6 +242,8 @@ $ echo 'first commit' | git commit-tree d8329f fdf4fc3344e67ab068f836878b6c4951e3b15f3d ---- +You will get a different hash value because of different creation time and author data. +Replace commit and tag hashes with your own checksums further in this chapter. Now you can look at your new commit object with `cat-file`: [source,console] diff --git a/book/10-git-internals/sections/packfiles.asc b/book/10-git-internals/sections/packfiles.asc index 9bdc9827a..1d520ef63 100644 --- a/book/10-git-internals/sections/packfiles.asc +++ b/book/10-git-internals/sections/packfiles.asc @@ -26,6 +26,7 @@ To demonstrate, we'll add the `repo.rb` file from the Grit library – this is a [source,console] ---- $ curl https://raw.githubusercontent.com/mojombo/grit/master/lib/grit/repo.rb > repo.rb +$ git checkout master $ git add repo.rb $ git commit -m 'added repo.rb' [master 484a592] added repo.rb @@ -81,7 +82,7 @@ $ git cat-file -s b042a60ef7dff760008df33cee372b945b6e884e 22054 ---- -You have two nearly identical 22K objects on your disk. +You have two nearly identical 22K objects on your disk (each compressed to approximately 7K). Wouldn't it be nice if Git could store one of them in full but then the second object only as the delta between it and the first? It turns out that it can. @@ -118,8 +119,8 @@ Because you never added them to any commits, they're considered dangling and are The other files are your new packfile and an index. The packfile is a single file containing the contents of all the objects that were removed from your filesystem. The index is a file that contains offsets into that packfile so you can quickly seek to a specific object. -What is cool is that although the objects on disk before you ran the `gc` were collectively about 22K in size, the new packfile is only 7K. -You've cut your disk usage by ⅔ by packing your objects. +What is cool is that although the objects on disk before you ran the `gc` were collectively about 15K in size, the new packfile is only 7K. +You've cut your disk usage by ½ by packing your objects. How does Git do this? When Git packs objects, it looks for files that are named and sized similarly, and stores just the deltas from one version of the file to the next.