On Mon, 11 Jul 2005, Linus Torvalds wrote:
> On Mon, 11 Jul 2005, Marc Singer wrote:
> >
> > From my POV, what I want is a branch with the tag v2.6.12 as the basis
> > of the branch. I'm guessing that -b means "make me a branch and call
> > it this".
>
> Yup. That would be the interface.
>
> > # git checkout -b BRANCH_NAME [TAG]
> >
> > If the TAG is omitted, the branch is made from the current HEAD or
> > some other reasonable point defined by the current working directory.
>
> That would be the most natural thing that would fall out of this kind of
> interface.
Ok, done.
Now, if you try to do
git checkout v2.6.12
git will complain with
git checkout: you need to specify a new branch name
and some day (when I can get my act together and have man-pages that
work), there would even be documentation for the "-b" flag to specify the
branch name. And indeed, if you only specify the branch name, it will
just create it and switch to it from the current HEAD.
So while there are no docs, the checkin comment hopefully says it all:
Linus
---
commit 91dcdfd3b5331d955cfb60edf8930f1b5c142905
Author: Linus Torvalds <[EMAIL PROTECTED]>
Date: Mon Jul 11 20:44:20 2005 -0700
Make "git checkout" create new branches on demand
In particular, if we check out something that isn't an old branch, it
now requires a new branch-name to check the thing out into.
So, for example:
git checkout -b my-branch v2.6.12
will create the new branch "my-branch", and start it at v2.6.12, while
git checkout master
will just switch back to the master branch.
Of course, if you want to create a new branch "my-branch" and _not_
check it out, you could have done so with just
git-rev-parse v2.6.12^0 > .git/refs/heads/my-branch
which I think I will codify as "git branch".
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html