# clone branching?

4 messages from 2008-08-11 to 2008-08-12. Participants: Trans, Miklos Vajna, Karl Hasselström.
Thread: https://gitlist.dev/t/14935

## Trans, 2008-08-11 18:24

Subject: clone branching?
Message-ID: <4b6f054f0808111124g58309f64v496ceb250a068985@mail.gmail.com>
URL: https://gitlist.dev/e/4b6f054f0808111124g58309f64v496ceb250a068985%40mail.gmail.com

```
Hi,

I'm new to this list and evaluating whether to use Git. On the whole I
really like Git, however, I'm not sure l like the way it handles
branching.

Can Git be effectively used if clone is used for branching, rather
then using the internal branch naming?

Thanks,
T.

```

## Miklos Vajna, 2008-08-11 19:17

Subject: Re: clone branching?
Message-ID: <20080811191727.GS18960@genesis.frugalware.org>
URL: https://gitlist.dev/e/20080811191727.GS18960%40genesis.frugalware.org
In-Reply-To: <4b6f054f0808111124g58309f64v496ceb250a068985@mail.gmail.com>

```
On Mon, Aug 11, 2008 at 02:24:23PM -0400, Trans <transfire@gmail.com> wrote:
> Can Git be effectively used if clone is used for branching, rather
> then using the internal branch naming?

See git clone -l.

You can also use git clone -s (but it may be dangerous, more info in the
manpage) and git-new-workdir (but that's only in contrib, you may have
issues with it).

```

## Karl Hasselström, 2008-08-11 20:39

Subject: Re: clone branching?
Message-ID: <20080811203917.GA20662@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20080811203917.GA20662%40diana.vm.bytemark.co.uk
In-Reply-To: <4b6f054f0808111124g58309f64v496ceb250a068985@mail.gmail.com>

```
On 2008-08-11 14:24:23 -0400, Trans wrote:

> I'm new to this list and evaluating whether to use Git. On the whole
> I really like Git, however, I'm not sure l like the way it handles
> branching.
>
> Can Git be effectively used if clone is used for branching, rather
> then using the internal branch naming?

Yes, definitely.

git supports multiple branches per repository/working copy, but
doesn't force you to have more than one. And it's very easy to pull
changes from one repo to another.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

```

## Karl Hasselström, 2008-08-12 07:34

Subject: Re: clone branching?
Message-ID: <20080812073435.GA30811@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20080812073435.GA30811%40diana.vm.bytemark.co.uk
In-Reply-To: <4b6f054f0808111324x5a7c44afj6f93bc1e36fc481a@mail.gmail.com>

```
On 2008-08-11 16:24:57 -0400, Trans wrote:

> On Mon, Aug 11, 2008 at 4:39 PM, Karl Hasselström <kha@treskal.com>
> wrote:
>
> > git supports multiple branches per repository/working copy, but
> > doesn't force you to have more than one. And it's very easy to
> > pull changes from one repo to another.
>
> In retrospect, It's more the tags I need rather then branches, but
> just the same... So if I have a repository like:
>
>   myapp/
>     1.0.0/
>     1.0.1/
>     1.1.0/
>     current/
>
> This would be okay? No other "giter" is going to look at this and
> think "what the hell?"

That would be OK. But "myapp" wouldn't be a repository -- it'd be a
directory that contains four repositories. Each of those repositories
would have a specific branch checked out, but they'd probably all
contain the full set of tags and branches.

> Hmm... actually I don't see how this can work. If .get is under
> current/ than no one will be able to see the tags on my shared repo,
> but if it is under myapp/ then I'd be branching and tagging my tags
> --that's doesn't make any sense. I'm confused.

All your repositories have a .git directory. That's what makes them
git reppositories.

I think what you need to do to get un-confused is to learn about how
git stores history. Specifically, that

  1. the history consists of a DAG of commits, and

  2. that branches and tags are just named pointers to commits.

http://eagain.net/articles/git-for-computer-scientists/ is a short and
sweet introduction.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

```
