]> git.cworth.org Git - cworth.org/commitdiff
Synchronize with 8ef46e0628c7f12844485b4c292940c0ddbe50a8 from hgbook-git
authorCarl Worth <cworth@cworth.org>
Sun, 30 Sep 2007 03:03:29 +0000 (20:03 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 30 Sep 2007 03:03:29 +0000 (20:03 -0700)
src/hgbook-git/tour.mdwn

index 9940c71520fb9361b2132df3879bcb11209b3d8c..21c17ba2b87a5f0499c7ab766da64b7e7a4125ca 100644 (file)
@@ -70,7 +70,7 @@ with git, meaning GNU Interactive Tools).
 
   * Gentoo
 
-       emerge git
+       emerge dev-util/git
 
   * OpenSUSE
 
@@ -121,8 +121,8 @@ command. If you are completely stuck, simply run “git help”; it will
 print a brief list of commonly-used commands, along with a description
 of what each does. If you ask for help on a specific command (such as
 "git help init"), it prints more detailed information. [XXX: Does "git
-help <foo>" work universally as a built-in or does it expect man to be
-present and just call out to "man git-<foo>"?]
+help \<foo\>" work universally as a built-in or does it expect man to be
+present and just call out to "man git-\<foo\>"?]
 
        [XXX: The original hgbook includes the complete output of "hg
        help init" at this point. I'm not including the corresponding
@@ -292,21 +292,21 @@ view of history.
        
            Create a standard "hello, world" program
 
-By default, this command prints a brief paragraph of output for each
-change to the project that was recorded. In git terminology, we
-call each of these recorded events a commit.
+This command prints a record of output for each change to the project
+that was recorded. In git terminology, we call each of these recorded
+events a commit.
 
-The fields in a record of output from “git log” are as follows.
+The default fields in a record of output from “git log” are as follows.
 
   * commit This field consists of a string of 40 hexadecimal characters.
     This is a unique identifier for referring to particular commits.
   * Author The identity of the person who authored the commit. This
     field consist of two sub-fields for the user's name and email
     address, (or at least an email-like idenitifer). Note that git
-    stores a separate "Committer" field for the person who commited
-    the change, (since often an author will email a change to a
-    maintainer that commits it). The "git log" command doesn't display
-    the Committer, but other git tools do.
+    also stores a separate "Committer" field for the person who
+    commited the change, (since often an author will email a change to
+    a maintainer that commits it). See below for how to instruct "git
+    log" to display it as well.
   * Date The date and time on which the commit was authored, (again
     stored separately from the date the change was committed).
     timezone in which it was created. (The date and time are displayed
@@ -315,8 +315,13 @@ The fields in a record of output from “git log” are as follows.
     entered to describe the commit, (generally a one-line summary
     followed by more supporting text).
 
-The default output printed by “git log” is purely a summary; it is
-missing a lot of detail.
+The output of the "git log" command can be made more or less verbose
+by means of the --pretty option. For example, with "git log
+--pretty=short" the commit identifier will be omitted and only the
+first line of each commit message will be show. And with "git log
+--pretty=fuller", (the name 'fuller' is in contrast to the default
+--pretty=full), the committer name and dates will be printed in
+addition to the author name and dates.
 
 #### 2.4.1 Commits, revisions, and talking to other people
 
@@ -525,10 +530,10 @@ conventions for options that are common to modern Linux and Unix
 systems.
 
   * Most options have long names. For example, as we’ve already seen,
-    the “git log" command accepts a --max-count=<number> option.
+    the “git log" command accepts a --max-count=\<number\> option.
   * Some options have short, single-character names. Often these are
-    aliases for long commands, (such as "-n <number>" instead of
-    --max-count=<number>), but sometimes the option exists in
+    aliases for long commands, (such as "-n \<number\>" instead of
+    --max-count=\<number\>), but sometimes the option exists in
     short-form with no long-form equivalent, (such as -p). [XXX: It
     wouldn't hurt to fix this by adding --patch, etc. right?]
   * Long options start with two dashes (e.g. --max-count), while short
@@ -574,7 +579,7 @@ what git knows about the files in the repository.
        no changes added to commit (use "git add" and/or "git commit -a")
 
 First "git status" tells us that the current branch is "master". This
-means that the master branch is what will be updatea when we create a
+means that the master branch is what will be updated when we create a
 new commit.
 
 Note: In git a branch is a very simple notion---it's simply a name
@@ -625,10 +630,11 @@ do this.
 
 #### 2.7.1 Introducing yourself to git
 
-Before we run "git commit" though, we should introduce ourself to git.
-Git records your name and address with each change that you commit,
-(as both author and committer unless you tell it otherwise), so that
-you and others will later be able to tell who made each change.
+Before you run "git commit" though, you should introduce yourself to
+git.  Git records your name and email address with each change that
+you commit, (as both author and committer unless you tell it
+otherwise), so that you and others will later be able to tell who made
+each change.
 
 Git tries to automatically figure out a sensible name and address to
 attribute to both author and committer if you haven't explicitly told
@@ -642,13 +648,13 @@ attempt each of the following methods, in order, (stopping for each of
 the author and committer name and email as soon as a value is found):
 
   1. If you specify a --author option to the “git commit” command on
-     the command line, followed by a "Real Name <email@example.com>"
+     the command line, followed by a "Real Name \<email@example.com\>"
      string, then this name and addresss will be used for the author
      fields. The committer fields will still be determined as
      below. This option is very helpful for when applying a commit
      originally authored by someone other than yourself.
-  2. If any of the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL,
-     GIT_COMMITTER_NAME, or GIT_COMMITER_EMAIL environment variables
+  2. If any of the `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`,
+     `GIT_COMMITTER`_NAME, or `GIT_COMMITER_EMAIL` environment variables
      are set, then those values will be used for the corresponding
      fields.
   3. If you have a file in your home directory called .gitconfig, with
@@ -660,7 +666,7 @@ the author and committer name and email as soon as a value is found):
      again with name or email settings in the [user] section, then
      these values will be used to set any remaining author and
      committer fields.
-  5. If you have set the EMAIL environment variable, this will be used
+  5. If you have set the `EMAIL` environment variable, this will be used
      to set author and committer email addresses if still unset.
   6. git will query your system to find out your real name from
      available GECOS field and your username, hostname, and domain to
@@ -671,7 +677,7 @@ If all of these mechanisms fail, "git commit" will fail, printing an
 error message instructing you how to use "git config" to tell git your
 name and email address.
 
-You should think of the GIT_AUTHOR/COMMITER_NAME/EMAIL environment
+You should think of the `GIT_AUTHOR`/`COMMITER_NAME`/`EMAIL` environment
 variables and the --author option to the “git commit” command as ways
 to override git’s default selection. For normal use, the simplest and
 most robust way to set your information is by creating a .gitconfig
@@ -722,7 +728,7 @@ as a comment.
 You can use any text you like as the value of the name and email
 configuration items, since this information is for reading by other
 people, not for interpreting by git. It is conventional to use your
-actual name as well as a valid email address. But some poepl, (notably
+actual name as well as a valid email address. But some people, (notably
 Linus Torvalds, the original author of git), actually like the default
 username@hostname convention that git falls back on without any
 additional information about an email address. There's no requirement
@@ -744,12 +750,12 @@ after we’ve finished committing.
 Note: The -a on the command-line instructs git to commit the new
 content of *all* tracked files that have been modified. This is a
 convenience over explicitly listing filenames to be committed on the
-"git commit" command line. It is useful to use "git commit <files>"
+"git commit" command line. It is useful to use "git commit \<files\>"
 when there is a need to commit only some subset of the files that have
 been modified.
 
 If new files need to be committed for the first time, just use "git
-add <file>" before "git commit -a". If a file needs to be removed,
+add \<file\>" before "git commit -a". If a file needs to be removed,
 just remove it as normal before committing and "git commit -a" will
 notice that---it does not need to be explicitly told about the
 removal.
@@ -868,8 +874,8 @@ it. Wouldn't it be nice to touch those up before I post this commit
 with a never-to-be-changed again commit identifier?
 
 This is the exact situation for which "git commit --amend" was
-
-So I can just run that now and fix the broken commit message:
+invented. So I can just run that now and fix the broken commit
+message:
 
        $ git commit --amend
 
@@ -1090,7 +1096,7 @@ markers in the files and instruct you to resolve the conflicts. When
 you are finished, you would issue a "git commit -a" to create the
 merge commit.
 
-#### 2.8.3 Using "git remote" to pull changes other repositories
+#### 2.8.3 Using "git remote" to pull changes from other repositories
 
 We've already described how "git pull" will pull in changes from the
 repository which was the origin of the clone operation. Git also