# Cloning of git-svn repos?

3 messages from 2007-04-18 to 2007-04-19. Participants: Robin H. Johnson, Steven Grimm, Sam Vilain.
Thread: https://gitlist.dev/t/7725

## Robin H. Johnson, 2007-04-18 09:29

Subject: Cloning of git-svn repos?
Message-ID: <20070418092916.GI31488@curie-int.orbis-terrarum.net>
URL: https://gitlist.dev/e/20070418092916.GI31488%40curie-int.orbis-terrarum.net

```
(This is completely unrelated to my previous posts about using git for
Gentoo, it's not the only placing I'm looking at implementing Git).

Is there a sane and git-recommended way to clone repos created with
git-svn?

If I do: 'git-svn clone ....', and then git-clone of that directory, the
second clone cannot use git-svn to follow the original SVN or feed stuff
back to the original SVN.

If I create them separately (or by plain copying the first one to create
the second), then pulling between them works fine.

The copying just feels messy compared to the initial git-clone
functionality.

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

```

## Steven Grimm, 2007-04-18 17:21

Subject: Re: Cloning of git-svn repos?
Message-ID: <462653AD.5060902@midwinter.com>
URL: https://gitlist.dev/e/462653AD.5060902%40midwinter.com
In-Reply-To: <20070418092916.GI31488@curie-int.orbis-terrarum.net>

```
Robin H. Johnson wrote:
> Is there a sane and git-recommended way to clone repos created with
> git-svn?
>
> If I do: 'git-svn clone ....', and then git-clone of that directory, the
> second clone cannot use git-svn to follow the original SVN or feed stuff
> back to the original SVN.
>   

There is some git-svn-specific data in the .git directory that isn't 
copied by git clone. You could perhaps get away with just copying that 
(some stuff in .git/config, and the .git/svn subdirectory) into a cloned 
child.

What I usually do instead is make a parent repository with git-svn, then 
clone that as needed. I have a cron job that does "git-svn fetch" in the 
parent periodically, so the child repositories can just update from the 
parent to stay current. When I want to commit to svn, I push to the 
parent repo (be careful here since git-svn can't create non-bare 
repositories, so don't ever push to the currently checked-out branch in 
the parent), git-reset the parent to whatever svn branch I want to check 
into, merge the just-pushed change into the parent's current branch, 
then do my git-svn dcommit.

That workflow could undoubtedly be made simpler. In particular, one 
could use hooks in the parent repository to automatically do the 
reset-merge-dcommit dance. If you had that, then pushing to the parent 
would immediately commit those changes to svn and there'd be little 
reason to want to do svn operations from the cloned children.

-Steve

```

## Sam Vilain, 2007-04-19 13:03

Subject: Re: Cloning of git-svn repos?
Message-ID: <462768B9.5030102@vilain.net>
URL: https://gitlist.dev/e/462768B9.5030102%40vilain.net
In-Reply-To: <20070418092916.GI31488@curie-int.orbis-terrarum.net>

```
Robin H. Johnson wrote:
> (This is completely unrelated to my previous posts about using git for
> Gentoo, it's not the only placing I'm looking at implementing Git).
>
> Is there a sane and git-recommended way to clone repos created with
> git-svn?
>
> If I do: 'git-svn clone ....', and then git-clone of that directory, the
> second clone cannot use git-svn to follow the original SVN or feed stuff
> back to the original SVN.
>   

You need to make sure to clone the remotes/ refs as well.  See
http://utsl.gen.nz/talks/git-svn/intro.html#howto-track-svn

Sam.

> If I create them separately (or by plain copying the first one to create
> the second), then pulling between them works fine.
>
> The copying just feels messy compared to the initial git-clone
> functionality.
>
>   

```
