git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Cloning of git-svn repos?

From
Steven Grimm <koreth@midwinter.com>
Date
Apr 18, 2007, 17:21 UTC
Message-ID
<462653AD.5060902@midwinter.com>
In-Reply-To
<20070418092916.GI31488@curie-int.orbis-terrarum.net>
Robin H. Johnson wrote:
Show 7 quoted lines
> 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
Previous: Robin H. JohnsonNext: Sam Vilain
Message 2 of 3 in “Cloning of git-svn repos?”
  1. Robin H. JohnsonApr 18, 2007
  2. Steven GrimmApr 18, 2007
  3. Sam VilainApr 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.