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

Re: git-svn clone on a central server

From
PHPeter Harris <git@peter.is-a-geek.org>
Date
Mar 17, 2008, 15:01 UTC
Message-ID
<eaa105840803170801p4155f21bpabc828a3be0e4aaa@mail.gmail.com>
In-Reply-To
<frjbtf$rd0$1@ger.gmane.org>
On Sun, Mar 16, 2008 Bruno Harbulot wrote:
Show 10 quoted lines
>  The way I'm planning to use this is to create a "central" bare
>  repository on the server (by moving the '.git' directory and setting
>  bare=true in the config file) that I would like to keep in sync with the
>  original SVN repository (and also push by own branches).
>  I'd like then to pull these changes to my working copies of that central
>  repository. I'm not quite sure how to update this central bare git
>  repository (and then its clones) with the changes in the SVN repository
>  upstream. (By the way, I'm not planning to 'dcommit' anything directly,
>  just reading from this SVN.) Are there any recommendation on how to
>  achieve this?

I run "git svn fetch" hourly (and "git gc" daily) from cron on my 'server'. My working copies, I just "git pull" when I want an update as usual.

I also occasionally "git svn (fetch|rebase|dcommit)" in my working copies. Just remember to blow away .git/svn after each "git (fetch|pull)" so that git-svn knows to rebuild the local index. Also, you just have to wait for the central 'server' to run another update before your next "git (fetch|pull)", or it will rewind the state of your svn branches.

(Also note that state can get out of sync if an svn log message or author changes between the working copy's "git svn (fetch|rebase|dcommit)" and when the server's cron job triggers - basically never, unless you happen to have coworkers who like to ammend their svn log messages shortly after making a commit)

I don't push branches to my 'svn fetch' repo (I use a separate repo for that), but I don't see why it would cause a problem.

I'm sure there are other ways to do this.
Peter Harris
Previous: Bruno Harbulot
Message 4 of 4 in “git-svn clone on a central server”
  1. Bruno HarbulotMar 15, 2008
  2. Peter HarrisMar 15, 2008
  3. Bruno HarbulotMar 16, 2008
  4. Peter HarrisMar 17, 2008

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.