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

Re: git svn and multiple cloned repositories

From
PHPeter Harris <git@peter.is-a-geek.org>
Date
Jun 30, 2009, 13:44 UTC
Message-ID
<eaa105840906300644s6bc9b619i24bd54537f4a67d4@mail.gmail.com>
In-Reply-To
<h2d043$4tm$1@ger.gmane.org>
On Tue, Jun 30, 2009 at 8:23 AM, Bruno Harbulot wrote:
Show 21 quoted lines
> I participate in a few open-source projects for which I provide patches
> sometimes, but most of these projects use Subversion. git-svn is very
> convenient for trying out patches without interfering with the main branch
> (so as to submit them when they're ready). I presume many 'git svn' users do
> something like this too.
>
> However, I'd like to keep multiple copies of this repository (on a few
> machines, including one on a backup server) with the appropriate SVN
> metadata. I'd also like to be able to do 'git svn fetch' on only one of
> these cloned repositories (perhaps via crontab on the server) and to be able
> to push/pull this SVN metadata along with the commits between the cloned git
> repositories.
>
>
> Is there a recommended way to do this?
>
>
> I have found 3 ways of achieving this, but none of them seem ideal:
>
> 1. Copying the entire cloned repository as regular files and doing 'git svn
> fetch' regularly on each copy.
> 2. Transferring the SVN references by hand.
> 3. Using 'git clone --mirror' (only works with --bare option).
I use 4. Set up git remotes by hand to populate svn remotes directly.
  - On 'backup-server':
git svn clone -s svn://upstream/project
crontab -e  # run git svn fetch periodically
  - On 'machineX':
mkdir project
cd project
git init
git remote add origin git://mirror/project
git config --add remote.origin.fetch refs/remotes/*:refs/remotes/*
git fetch
git svn init -s svn://upstream/project
git reset --hard trunk
git svn rebase
Peter Harris
Previous: Bruno Harbulot
Message 2 of 2 in “git svn and multiple cloned repositories”
  1. Bruno HarbulotJun 30, 2009
  2. Peter HarrisJun 30, 2009

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.