Re: README rewrite
- From
Petr Baudis <pasky@ucw.cz>
- Date
- May 15, 2005, 17:28 UTC
- Message-ID
- <20050515172802.GH13024@pasky.ji.cz>
- In-Reply-To
- <20050515155315.GE7391@tumblerings.org>
Dear diary, on Sun, May 15, 2005 at 05:53:15PM CEST, I got a letter where Zack Brown <zbrown@tumblerings.org> told me that...
Show 11 quoted lines
> On Sun, May 15, 2005 at 08:40:41AM -0700, Zack Brown wrote: > > This much I think I understand. What I don't understand is how to actually use > > branches. I don't see a Cogito command to create or destroy them. > > Or I'm blind. The cg-branch-add command is right there. It also has a long > comment at the top of the script. Unfortunately the comment only describes how > to use the command, not what exactly branches are or how to work with them. > > Clearly 'branches' are diverging branches of development. But if I have my > own tree, with several branches in it, it's unclear to me how to specify > which branch I'm actually working on at any given moment.
I think it's actually very BKish. Each repository has its own "master" branch, which always corresponds with your current branch of development. That is, your working tree is always represented by the "master" branch.
The rest of branches are "remote", that is they just point at the other repositories. When you want to get the new changes from them, you cg-pull, or cg-update to merge them to your branch too.
So if you want to create a new branch, you cg-clone the original branch. And if you want to refer to the new branch in any other branch, you cg-branch-add it in the other branch.
So the local branch is the "master" branch, the rest are "remote" branches. Note that there is a theoretical support for multiple local branches, but I decided not to make things even more confusing and there is no Cogito interface for managing them now.
I will add cg-switch which will switch the master branch to some other branch (e.g. cg-switch linus will rename your current master to master-1234 or something, update your "origin" branch to point to the "linus" branch, and make your "master" branch to point at the same commit as the "origin" branch). I might also do something like cg-branch-add --local, which will add a local branch and you could then cg-switch to it too.
-- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor