From: Santi Béjar Date: Wed, 01 Jun 2005 14:41:38 GMT Subject: Re: [COGITO PATCH] cg-branch-switch and local branches Message-ID: <87mzqaqgv1.fsf@gmail.com> In-Reply-To: <87ekbmi5zl.fsf@ifae.es> Hi, after reading it I think I have to explain it better. And first I have to say that this patch depends on my patches in the thread "[COGITO PATCH] Heads and tags in subdirectories". But the logic does not depend on it, I think :) Suppose I want to make some modifications to the cogito. So I do: cg-clone cogito rsync://rsync.kernel.org/pub/scm/cogito/cogito.git the first argument been the name I've gave to this repositori. Now I can do the changes/commits in the usual way. But I want to work in two differents patches, named dirs and switch, so I do: cg-branch-add dirs cogito cg-branch-add switch cogito Now I have to local branches with their respective names, and the origin been the cogito branch for both (but it can be different). If I want to work on the dirs branch I do: cg-branch-switch dirs an the same for switch. In each case I can do a: cg-merge origin and merge their respective origin (in this case is the same). If I want to work directly in cogito, I can do: cg-branch-switch cogito and work in the usual way. If the cogito repository have a branche called cogito2 I could do: cg-branch-switch cogito#cogito2 in the case I've already pulled this branch. Internally it is: Local branches -------------- The master file is always a link: master -> ${localbranch} The content of $_git/branches/${localbranch} is the original branch of local branch. The cases and the corresponding origin links are: 1a.- name : a name of an external repository $branch corresponding to the definition origin -> $name/$branch 1b.- name#branch : optionally with a branch origin -> $name/$branch 2 .- name : a name of another local branch $branch corresponding to the definition origin -> $name/$branch Local unnamed branches ---------------------- The master file is a regular file and the origin link only has the cases 1a and 1b where the $name is name of the local branch.