From: Santi Béjar Date: Wed, 03 Jan 2007 14:09:02 GMT Subject: Re: [PATCH] Documentation/tutorial: misc updates Message-ID: <8aa486160701030609g22eadf0brf8743dad5701f315@mail.gmail.com> In-Reply-To: <200701031350.l03Doulu015800@laptop13.inf.utfsm.cl> On 1/3/07, Horst H. von Brand wrote: > Santi Béjar wrote: > > Three changes: > > 1) Teach how to delete a branch with "git branch -d name". > > 2) The first commit does not have a parent. > > 3) Teach "git show" instead of "git cat-file -p". > > --- > > Documentation/tutorial.txt | 17 +++++++++++++---- > > 1 files changed, 13 insertions(+), 4 deletions(-) > > > > diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt > > index d043e84..f0a5526 100644 > > --- a/Documentation/tutorial.txt > > +++ b/Documentation/tutorial.txt > > @@ -222,6 +222,15 @@ $ gitk > > > > will show a nice graphical representation of the resulting history. > > > > +At this point you could delete the experimental branch with > > + > > +------------------------------------------------ > > +$ git branch -d experimental > > +------------------------------------------------ > > + > > +This command ensures that the changes in the experimental branch are > > +already in the current branch. > > + > > Huh? This deletes the branch, it doesn't ensure changes have been saved. It deletes the branch only if the current branch is fast-forwarding it. Could be rephrase as: This command only delete the experimental branch if it is already merge in the current branch. > > > If you develop on a branch crazy-idea, then regret it, you can always > > delete the branch with > > > > @@ -391,8 +400,8 @@ $ git show HEAD # the tip of the current branch > > $ git show experimental # the tip of the "experimental" branch > > ------------------------------------- > > > > -Every commit has at least one "parent" commit, which points to the > > -previous state of the project: > > +Every commit has at least one "parent" commit (except the first), > > +which points to the previous state of the project: > > And how can it have more than one parent? If you mention it, better come > clean about merges (can be explained in detail later). I have not mentined it, I've just added the exception that the firt/root commits have zero parents. > > > ------------------------------------- > > $ git show HEAD^ # to see the parent of HEAD > > And if there are several parents? Already explained before. > > > @@ -510,10 +519,10 @@ of the file: > > $ git diff v2.5:Makefile HEAD:Makefile.in > > ------------------------------------- > > HEAD:Makefile.in doesn't need HEAD. Not needed if the Makefile.in in the working directory is equal to the file in HEAD. But better explain new things. Santi