# How to create a branch without any links to the others branches

9 messages from 2008-08-29 to 2008-08-29. Participants: Francis Moreau, Alex Riesen, Nguyen Thai Ngoc Duy, Junio C Hamano.
Thread: https://gitlist.dev/t/15273

## Francis Moreau, 2008-08-29 08:27

Subject: How to create a branch without any links to the others branches
Message-ID: <38b2ab8a0808290127o32621d09vac07e7811e6e8139@mail.gmail.com>
URL: https://gitlist.dev/e/38b2ab8a0808290127o32621d09vac07e7811e6e8139%40mail.gmail.com

```
Hello,

I'm wondering how such branches are created in a repository.

For example, how todo, man and html branches from the git repository
have been created ?

Looking at git-branch man, a "start-point:" must be specified if not the
current branch is assumed.

The only solution I'm seeing is to create a new repository with these
'unrelated' branches and pull them from the other repository.

Is this correct ?

Thanks
-- 
Francis

```

## Alex Riesen, 2008-08-29 09:27

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <81b0412b0808290227g328b793cl58a606e718b4b3ff@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0808290227g328b793cl58a606e718b4b3ff%40mail.gmail.com
In-Reply-To: <38b2ab8a0808290127o32621d09vac07e7811e6e8139@mail.gmail.com>

```
2008/8/29 Francis Moreau <francis.moro@gmail.com>:
>
> The only solution I'm seeing is to create a new repository with these
> 'unrelated' branches and pull them from the other repository.
>
> Is this correct ?
>

Almost:

$ rm .git/HEAD
$ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
$ git commit

```

## Francis Moreau, 2008-08-29 09:37

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <38b2ab8a0808290237l703b0394rad8f42c091d7143f@mail.gmail.com>
URL: https://gitlist.dev/e/38b2ab8a0808290237l703b0394rad8f42c091d7143f%40mail.gmail.com
In-Reply-To: <81b0412b0808290227g328b793cl58a606e718b4b3ff@mail.gmail.com>

```
On Fri, Aug 29, 2008 at 11:27 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
>
> $ rm .git/HEAD
> $ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
> $ git commit
>

well, it looks pretty git internal hack thing to me.

Shouldn't we add a new option to git-branch to do that, like:

    $ git branch --detach <new-branch>

?
-- 
Francis

```

## Alex Riesen, 2008-08-29 09:46

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <81b0412b0808290246j299371b0k7895308368266a01@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0808290246j299371b0k7895308368266a01%40mail.gmail.com
In-Reply-To: <38b2ab8a0808290237l703b0394rad8f42c091d7143f@mail.gmail.com>

```
2008/8/29 Francis Moreau <francis.moro@gmail.com>:
> On Fri, Aug 29, 2008 at 11:27 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
>>
>> $ rm .git/HEAD
>> $ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
>> $ git commit
>>
>
> well, it looks pretty git internal hack thing to me.
>
> Shouldn't we add a new option to git-branch to do that, like:
>
>    $ git branch --detach <new-branch>
>

Dunno. I never needed that explicitly. What do you want to do with it?

```

## Francis Moreau, 2008-08-29 12:17

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <38b2ab8a0808290517l75296521rf99f724cb1594f69@mail.gmail.com>
URL: https://gitlist.dev/e/38b2ab8a0808290517l75296521rf99f724cb1594f69%40mail.gmail.com
In-Reply-To: <81b0412b0808290246j299371b0k7895308368266a01@mail.gmail.com>

```
On Fri, Aug 29, 2008 at 11:46 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
>
> Dunno. I never needed that explicitly. What do you want to do with it?
>

I'd like to create branches as Junio did for html, man and todo ones.

Thanks
-- 
Francis

```

## Nguyen Thai Ngoc Duy, 2008-08-29 12:34

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <fcaeb9bf0808290534w5025b436s1087bb6a0ffcb16f@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0808290534w5025b436s1087bb6a0ffcb16f%40mail.gmail.com
In-Reply-To: <38b2ab8a0808290237l703b0394rad8f42c091d7143f@mail.gmail.com>

```
On 8/29/08, Francis Moreau <francis.moro@gmail.com> wrote:
> On Fri, Aug 29, 2008 at 11:27 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
>  >
>  > $ rm .git/HEAD
>  > $ echo ref: refs/heads/NEW-BRANCH-NAME > .git/HEAD
>  > $ git commit
>  >
>
>
> well, it looks pretty git internal hack thing to me.

There is an old thread that uses "git symbolic-ref" or something
instead of "echo...", it would look less hacky. Or you could create a
new repository, make a new branch there, then pull that branch to your
repository.
-- 
Duy

```

## Francis Moreau, 2008-08-29 12:51

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <38b2ab8a0808290551i3e2c608ax88e09368582bfd99@mail.gmail.com>
URL: https://gitlist.dev/e/38b2ab8a0808290551i3e2c608ax88e09368582bfd99%40mail.gmail.com
In-Reply-To: <fcaeb9bf0808290534w5025b436s1087bb6a0ffcb16f@mail.gmail.com>

```
On Fri, Aug 29, 2008 at 2:34 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> There is an old thread that uses "git symbolic-ref" or something
> instead of "echo...", it would look less hacky.

OK.

> Or you could create a new repository, make a new branch there,
> then pull that branch to your repository.

yes it's the only soultion I could come up with but I would have assumed
git-branch to be able to do that.

Thanks
-- 
Francis

```

## Junio C Hamano, 2008-08-29 15:04

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <7v4p536exq.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v4p536exq.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <38b2ab8a0808290517l75296521rf99f724cb1594f69@mail.gmail.com>

```
"Francis Moreau" <francis.moro@gmail.com> writes:

> On Fri, Aug 29, 2008 at 11:46 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
>>
>> Dunno. I never needed that explicitly. What do you want to do with it?
>>
>
> I'd like to create branches as Junio did for html, man and todo ones.

If that is the objective...

There is no reason whatsoever for these unrelated branches to _ORIGINATE_
from the same source repository.  The repositories you see at kernel.org
and repo.or.cz are merely public distribution points, and I push them into
a single repository at each of these places merely for downloaders
convenience, from separate repositories.

```

## Francis Moreau, 2008-08-29 19:18

Subject: Re: How to create a branch without any links to the others branches
Message-ID: <38b2ab8a0808291218t60be4d04u6c429f7b6c8e3f19@mail.gmail.com>
URL: https://gitlist.dev/e/38b2ab8a0808291218t60be4d04u6c429f7b6c8e3f19%40mail.gmail.com
In-Reply-To: <7v4p536exq.fsf@gitster.siamese.dyndns.org>

```
On Fri, Aug 29, 2008 at 5:04 PM, Junio C Hamano <gitster@pobox.com> wrote:
> If that is the objective...
>
> There is no reason whatsoever for these unrelated branches to _ORIGINATE_
> from the same source repository.

Well I find sometimes convenient to embed some temporary working files
and the project files at the same place.

>  The repositories you see at kernel.org
> and repo.or.cz are merely public distribution points, and I push them into
> a single repository at each of these places merely for downloaders
> convenience, from separate repositories.

OK.

thanks
-- 
Francis

```
