# Parent-less branches

7 messages from 2008-05-02 to 2008-05-03. Participants: Pedro Melo, Junio C Hamano, Wincent Colaiuta, Randal L. Schwartz, Johannes Schindelin.
Thread: https://gitlist.dev/t/13358

## Pedro Melo, 2008-05-02 21:05

Subject: Parent-less branches
Message-ID: <F26CE1A6-FE85-4AC6-BCE6-B41085A09F0F@simplicidade.org>
URL: https://gitlist.dev/e/F26CE1A6-FE85-4AC6-BCE6-B41085A09F0F%40simplicidade.org

```
Hi,

inside an existing repository I want to create a new branch without a  
parent commit. Is there a set of commands to do this? Usually only  
the initial commit of a

The idea is to use that branch to track an external source tarball.  
 From time to time, I would checkout the branch and dump a new  
tarball with fresh source code, commit it to the branch and merge  
again with my master.

I could create the setup this setup if I create a separate repo for  
each external source tarball and then fetch them into my main  
repository. But I don't need those repos after that so I'm just  
wondering if there is a way to create the empty branch directly.

Thanks,
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo@simplicidade.org
Use XMPP!

```

## Junio C Hamano, 2008-05-02 21:47

Subject: Re: Parent-less branches
Message-ID: <7vskx0wf8i.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vskx0wf8i.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <F26CE1A6-FE85-4AC6-BCE6-B41085A09F0F@simplicidade.org>

```
Pedro Melo <melo@simplicidade.org> writes:

> inside an existing repository I want to create a new branch without a
> parent commit. Is there a set of commands to do this?

Typically these commits come about because you created a completely
separate history elsewhere in a separate repository and fetched and/or
pulled from there.

So "a set of commands to do this" would be:

	go away
	git init
        build history as usual
	come back
        git fetch ..from that other repository..

```

## Wincent Colaiuta, 2008-05-02 22:32

Subject: Re: Parent-less branches
Message-ID: <0EACFC4A-F2E7-48D3-BE49-10D2B32AB470@wincent.com>
URL: https://gitlist.dev/e/0EACFC4A-F2E7-48D3-BE49-10D2B32AB470%40wincent.com
In-Reply-To: <7vskx0wf8i.fsf@gitster.siamese.dyndns.org>

```
El 2/5/2008, a las 23:47, Junio C Hamano escribió:
> Pedro Melo <melo@simplicidade.org> writes:
>
>> inside an existing repository I want to create a new branch without a
>> parent commit. Is there a set of commands to do this?
>
> Typically these commits come about because you created a completely
> separate history elsewhere in a separate repository and fetched and/or
> pulled from there.
>
> So "a set of commands to do this" would be:
>
> 	go away
> 	git init
>        build history as usual
> 	come back
>        git fetch ..from that other repository..

I wanted to do this just the other day, but I did it all inside the  
one repo, and made some notes on the process here:

http://rails.wincent.com/wiki/Creating_independent_branches_with_Git

Basically, using "git write-tree" and "git commit-tree" plumbing.

Cheers,
Wincent

```

## Pedro Melo, 2008-05-02 23:04

Subject: Re: Parent-less branches
Message-ID: <A8B95683-9832-4973-B920-8546CC55F162@simplicidade.org>
URL: https://gitlist.dev/e/A8B95683-9832-4973-B920-8546CC55F162%40simplicidade.org
In-Reply-To: <7vskx0wf8i.fsf@gitster.siamese.dyndns.org>

```
Hi,

On May 2, 2008, at 10:47 PM, Junio C Hamano wrote:

> Pedro Melo <melo@simplicidade.org> writes:
>
>> inside an existing repository I want to create a new branch without a
>> parent commit. Is there a set of commands to do this?
>
> Typically these commits come about because you created a completely
> separate history elsewhere in a separate repository and fetched and/or
> pulled from there.
>
> So "a set of commands to do this" would be:
>
> 	go away
> 	git init
>         build history as usual
> 	come back
>         git fetch ..from that other repository..

Yes, that is what I was using until today.

I was asking for a in-repo solution, without the second git init.

The following email by Wincent Colaiuta does exactly what I wanted :).

Thanks!
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo@simplicidade.org
Use XMPP!

```

## Pedro Melo, 2008-05-02 23:04

Subject: Re: Parent-less branches
Message-ID: <B5BADF6F-7CFF-4A6C-BE06-0994786D8D0F@simplicidade.org>
URL: https://gitlist.dev/e/B5BADF6F-7CFF-4A6C-BE06-0994786D8D0F%40simplicidade.org
In-Reply-To: <0EACFC4A-F2E7-48D3-BE49-10D2B32AB470@wincent.com>

```
Hi,

On May 2, 2008, at 11:32 PM, Wincent Colaiuta wrote:

> El 2/5/2008, a las 23:47, Junio C Hamano escribió:
>> Pedro Melo <melo@simplicidade.org> writes:
>>
>>> inside an existing repository I want to create a new branch  
>>> without a
>>> parent commit. Is there a set of commands to do this?
[...]
> I wanted to do this just the other day, but I did it all inside the  
> one repo, and made some notes on the process here:
>
> http://rails.wincent.com/wiki/Creating_independent_branches_with_Git

This is exactly what I needed, thanks!

Best regards,
-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: melo@simplicidade.org
Use XMPP!

```

## Randal L. Schwartz, 2008-05-02 23:34

Subject: Re: Parent-less branches
Message-ID: <863ap0gu14.fsf@blue.stonehenge.com>
URL: https://gitlist.dev/e/863ap0gu14.fsf%40blue.stonehenge.com
In-Reply-To: <A8B95683-9832-4973-B920-8546CC55F162@simplicidade.org>

```
>>>>> "Pedro" == Pedro Melo <melo@simplicidade.org> writes:

Pedro> I was asking for a in-repo solution, without the second git init.

Why?  Are they charging you extra to type git init now? :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

```

## Johannes Schindelin, 2008-05-03 14:05

Subject: Re: Parent-less branches
Message-ID: <alpine.DEB.1.00.0805031504390.30431@racer>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0805031504390.30431%40racer
In-Reply-To: <7vskx0wf8i.fsf@gitster.siamese.dyndns.org>

```
Hi,

On Fri, 2 May 2008, Junio C Hamano wrote:

> Pedro Melo <melo@simplicidade.org> writes:
> 
> > inside an existing repository I want to create a new branch without a 
> > parent commit. Is there a set of commands to do this?
> 
> Typically these commits come about because you created a completely 
> separate history elsewhere in a separate repository and fetched and/or 
> pulled from there.

It is funny.  I really like that approach, but too many people seem to be 
married to the concept that you have to stay in the same working 
directory, and rather play dirty tricks with the plumbing.

Ciao,
Dscho

```
