# split up a repository

8 messages from 2010-03-02 to 2010-03-03. Participants: Kovacs, Levente, Chris Packham, Sverre Rabbelier, Levente Kovacs, Avery Pennarun, Bill Lear.
Thread: https://gitlist.dev/t/22874

## Kovacs, Levente, 2010-03-02 00:12

Subject: split up a repository
Message-ID: <20100302011226.76fda85d@gmail.com>
URL: https://gitlist.dev/e/20100302011226.76fda85d%40gmail.com

```
Hi all,


Ok, I *WAS* an SVN user, so forgive my ignorance. I have successfully
migrated from SVN to git. However, I had only one repository under my
SVN server, which is not a good approach with git.

http://logonex.eu/git/?p=svn.git;a=summary

Now I have one git repository, which I'd like to split up to several others. Does it possible with git? If it is, how?

How can I split up a single repo to several others? It would be nice to
keep the history.

Thank you for your help in advance.

Levente

```

## Chris Packham, 2010-03-02 00:36

Subject: Re: split up a repository
Message-ID: <a038bef51003011636n6dda8296k655b9d367cee9e91@mail.gmail.com>
URL: https://gitlist.dev/e/a038bef51003011636n6dda8296k655b9d367cee9e91%40mail.gmail.com
In-Reply-To: <20100302011226.76fda85d@gmail.com>

```
Hi,

On Mon, Mar 1, 2010 at 4:12 PM, Kovacs, Levente <leventelist@gmail.com> wrote:
> Hi all,
>
>
> Ok, I *WAS* an SVN user, so forgive my ignorance. I have successfully
> migrated from SVN to git. However, I had only one repository under my
> SVN server, which is not a good approach with git.
>
> http://logonex.eu/git/?p=svn.git;a=summary
>
> Now I have one git repository, which I'd like to split up to several others. Does it possible with git? If it is, how?
>
> How can I split up a single repo to several others? It would be nice to
> keep the history.
>
> Thank you for your help in advance.
>
> Levente
> --

'git filter-branch' should do what you need. Have a read of this [1]
recent discussion and the docs for filter-branch [2].

[1] http://thread.gmane.org/gmane.comp.version-control.git/138382
[2] http://www.kernel.org/pub/software/scm/git/docs/v1.7.0.1/git-filter-branch.html

```

## Sverre Rabbelier, 2010-03-02 10:40

Subject: Re: split up a repository
Message-ID: <fabb9a1e1003020240h81f3e99wea1185c080a03b0@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e1003020240h81f3e99wea1185c080a03b0%40mail.gmail.com
In-Reply-To: <20100302011226.76fda85d@gmail.com>

```
Heya,

On Tue, Mar 2, 2010 at 01:12, Kovacs, Levente <leventelist@gmail.com> wrote:
> How can I split up a single repo to several others? It would be nice to
> keep the history.

Sounds like a job for.... subtree man! Avery (cc-ed) has written a
program 'git subtree' that lets you split off subtrees from a git
repository (and optionally merge them back later on). I reckon that's
what you want, yes?

-- 
Cheers,

Sverre Rabbelier

```

## Sverre Rabbelier, 2010-03-02 23:19

Subject: Re: split up a repository
Message-ID: <fabb9a1e1003021519y7159a3dal3aa3a7514329fb9a@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e1003021519y7159a3dal3aa3a7514329fb9a%40mail.gmail.com
In-Reply-To: <20100303002132.5df20326@gmail.com>

```
Heya,

On Wed, Mar 3, 2010 at 00:21, Levente Kovacs <leventelist@gmail.com> wrote:
> Ok. Really newbie question here. Just before I start to mess up my
> repositories.

PROTIP: Back up your repository before messing with it ;).

> I've cloned the git-subtree, and the install script would put
> the script into /usr/lib/git-core. Is there any way to install the script
> somewhere under /usr/local ?

I'll leave git subtree specific questions to Avery :).

-- 
Cheers,

Sverre Rabbelier

```

## Levente Kovacs, 2010-03-02 23:21

Subject: Re: split up a repository
Message-ID: <20100303002132.5df20326@gmail.com>
URL: https://gitlist.dev/e/20100303002132.5df20326%40gmail.com
In-Reply-To: <fabb9a1e1003020240h81f3e99wea1185c080a03b0@mail.gmail.com>

```
On Tue, 2 Mar 2010 11:40:41 +0100
Sverre Rabbelier <srabbelier@gmail.com> wrote:

> Sounds like a job for.... subtree man!

Yes, it seems!

Ok. Really newbie question here. Just before I start to mess up my
repositories. I've cloned the git-subtree, and the install script would put
the script into /usr/lib/git-core. Is there any way to install the script
somewhere under /usr/local ?

Thanks,

-- 
Levente Kovacs
http://logonex.eu

-- 
Levente Kovacs
http://logonex.eu

```

## Avery Pennarun, 2010-03-03 01:40

Subject: Re: split up a repository
Message-ID: <32541b131003021740n32535fbbh802af418ea0898aa@mail.gmail.com>
URL: https://gitlist.dev/e/32541b131003021740n32535fbbh802af418ea0898aa%40mail.gmail.com
In-Reply-To: <20100303002132.5df20326@gmail.com>

```
On Tue, Mar 2, 2010 at 6:21 PM, Levente Kovacs <leventelist@gmail.com> wrote:
> On Tue, 2 Mar 2010 11:40:41 +0100
> Ok. Really newbie question here. Just before I start to mess up my
> repositories. I've cloned the git-subtree, and the install script would put
> the script into /usr/lib/git-core. Is there any way to install the script
> somewhere under /usr/local ?

The actual function of git-subtree is one single file.  You can just
copy it to wherever you like.  Personally, I add the git-subtree
source directory to my PATH from .bashrc... but I guess I'm special
because I also change my version of git-subtree a lot :)

Make sure to run 'make test' first so you know it's working on your computer.

And I'll second Sverre's suggestion to *always* back up your
repository before doing weird stuff (although git-subtree is designed
to refuse to overwrite existing branches, and nobody has ever reported
it damaging anything).

Have fun,

Avery

```

## Bill Lear, 2010-03-03 14:04

Subject: Re: split up a repository
Message-ID: <19342.27760.544227.835077@blake.zopyra.com>
URL: https://gitlist.dev/e/19342.27760.544227.835077%40blake.zopyra.com
In-Reply-To: <32541b131003021740n32535fbbh802af418ea0898aa@mail.gmail.com>

```
On Tuesday, March 2, 2010 at 20:40:57 (-0500) Avery Pennarun writes:
>On Tue, Mar 2, 2010 at 6:21 PM, Levente Kovacs <leventelist@gmail.com> wrote:
>> On Tue, 2 Mar 2010 11:40:41 +0100
>> Ok. Really newbie question here. Just before I start to mess up my
>> repositories. I've cloned the git-subtree, and the install script would put
>> the script into /usr/lib/git-core. Is there any way to install the script
>> somewhere under /usr/local ?
>
>The actual function of git-subtree is one single file....

Does git-subtree support branching of the "main" repository and
sub-trees in coordinated (one step) fashion?


Bill

```

## Avery Pennarun, 2010-03-03 19:19

Subject: Re: split up a repository
Message-ID: <32541b131003031119i5f7baefelc2784ccca90eca41@mail.gmail.com>
URL: https://gitlist.dev/e/32541b131003031119i5f7baefelc2784ccca90eca41%40mail.gmail.com
In-Reply-To: <19342.27760.544227.835077@blake.zopyra.com>

```
On Wed, Mar 3, 2010 at 9:04 AM, Bill Lear <rael@zopyra.com> wrote:
> Does git-subtree support branching of the "main" repository and
> sub-trees in coordinated (one step) fashion?

Yes.

Avery

```
