Re: Git branch bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 5 May 2007, Junio C Hamano wrote:

> Daniel Barkalow <barkalow@xxxxxxxxxxxx> writes:
> 
> > This leaves open the question of how you make your initial commit in a 
> > branch that isn't master. I think the answer should be:
> >
> >  $ git checkout -b experimental
> >  warning: You appear to be on a branch yet to be born.
> >  warning: Forcing checkout of HEAD.
> >  fatal: just how do you expect me to merge 0 trees?
> >
> > Which should probably be:
> >
> >  $ git checkout -b experimental
> >  warning: You appear to be on a branch yet to be born.
> >  warning: Putting you on a new branch yet to be born.
> >
> > And leaving .git/HEAD pointing to refs/heads/experimental instead of 
> > refs/heads/master, with refs/heads/ still empty.
> 
> While I agree that is probably correct, it would not be useful
> in real-life that much.  When you do not even have 'master', I
> do not think there is much point of being able to create two
> useless, yet-to-be-born branches.

The point is that you may not want to have a branch named "master", but 
rather want your first branch to be named something else. Your project 
could be such that "master" would be a confusing term to use for a 
default branch. Currently, it's awkward to start a project that avoids 
that particular name, which is what it seemed to me that the original 
poster was trying to do.

I don't think it's useful to be able to switch to a new yet-to-be-born 
branch from any other state, but I do think it's useful to be able to 
choose what the first branch is.

	-Daniel
*This .sig left intentionally blank*
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]