views:

109

answers:

2

I have a subversion repository with a directory structure:

frontend
backend
  + a
  + b

In a other branch, someone had put the sub-folders a and b in the root directory and delete the other stuff (frontend, backend).

a
b

Now i have to merge this branch back into the trunk (backend-folder). How can I do that to dont lose the history from the branches? I use git to access and work with the subversion repository.

+1  A: 

git-svn should be able to import the history correctly considering it uses by default the --follow-parent option:

--follow-parent

This is especially helpful when we're tracking a directory that has been moved around within the repository, or if we started tracking a branch and never tracked the trunk it was descended from.
This feature is enabled by default, use --no-follow-parent to disable it.

If that does not work, making the right change (i.e. merging that branch in order to get back the original, already imported with git-svn, directory structure) directly in SVN before git-svn it, as khmerbaise suggests in the comment, might be a good workaround.

VonC
A: 

I wrote a blog post on this subject a while back:

git-svn with non-standard repository layouts

Kevin Chan