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

Transplant branch from one repo to another

From
APAneurin Price <aneurin.price@gmail.com>
Date
Jun 16, 2009, 21:30 UTC
Message-ID
<501db8660906161430o25a0c18aw41758390dc171702@mail.gmail.com>
Hello all,

I have a repository cloned from SVN using 'git svn clone http://servername/path -T trunk -b branches -t tags', or thereabouts, and I've since realised that I would have been better off with 'git svn clone http://servername/path/trunk/subdir', as I don't really care about any other branches, or about the contents of the svn repository outside of 'subdir'.

I have one branch from trunk in which I've been working, which includes one merge from trunk. I'm interested in how I might be able to get the content of that branch and transplant it onto the new svn clone, starting at the equivalent parent commit (ie. the same svn revision). The merge was only a few commits away from HEAD, so I can manually redo that last part if it complicates things too much.

I've been thinking about something involving 'filter-branch --subdirectory-filter' followed by a fast-export on the source, and then a fast-import on the destination, but I'm not sure I'm going about this the right way and would appreciate any advice anyone can give me.

So, does anybody have any suggestions for how I should do this? Thank you for your time, Nye

Message 1 of 1 in “Transplant branch from one repo to another”
  1. Aneurin PriceJun 16, 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.