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

Re: git-svn: importing branches later

From
Michael Hendricks <michael@ndrix.org>
Date
May 8, 2007, 15:34 UTC
Message-ID
<20070508153428.GB5349@ginosko.local>
In-Reply-To
<m2odkv2wtd.fsf@ziti.local>
On Tue, May 08, 2007 at 07:51:10AM -0700, Seth Falcon wrote:
Show 18 quoted lines
> Karl Hasselström <kha@treskal.com> writes:
> 
> > On 2007-05-07 13:07:06 -0600, Michael Hendricks wrote:
> >
> >> Now I want to import the 'foo' branch from the same SVN repo without
> >> grabbing all the branches. Any suggestions?
> >
> > I seem to recall that just adding another "fetch" line to the git-svn
> > configuration in .git/config will do this for you.
> 
> Yes, this should work.  As long as you started out with a fairly
> recent git (sorry, I don't know how recent is needed) you should have
> in your repository a git/config file containing something like:
> 
>     [svn-remote "svn"]
>     	url = http://main.svn.url.com/
>     	fetch = trunk:refs/remotes/git-svn
>     	fetch = branches/b1:refs/remotes/b1  <-- this line added by you
Thanks Seth and Karl, that does indeed work.

I noticed that after changing .git/config and running fetch, git-svn retrieves the log for the entire project (presumably because it doesn't know when the new branch was created). In one project with ~30,000 revisions, I found it beneficial to specify "git svn fetch -r 12345:HEAD" where revision 12345 is somewhere close to and before the point at which the new branch was created from trunk. That makes the initial fetch must faster.

-- 
Michael
Previous: Seth Falcon
Message 4 of 4 in “git-svn: importing branches later”
  1. Michael HendricksMay 7, 2007
  2. Karl HasselströmMay 8, 2007
  3. Seth FalconMay 8, 2007
  4. Michael HendricksMay 8, 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.