1

I basically have the following git repo layout

x ---- a -------------- b  -------------- c  ---->
         y -- 1 -- 2 -- ┛  z -- i -- j -- ┛

where x, y, z are initial commits. I have these multiple initial commits because I merged multiple git repositories into one big repositories using

git fetch git://github.com/<user>/<repo>.git refs/heads/master:refs/heads/<repo>
git merge --no-commit <repo>
git read-tree --reset -u HEAD
git read-tree -u --prefix=lib/<repo> <repo>
git commit -m "Pulling <repo>"
git branch -d <repo>

multiple times. All submodules basically had the same file layout.

To import the git repo into svn I initialized an empty svn repository and cloned it via

git svn clone http://some/svn/repo/my-project

then I tried

cd my-project
git remote add dev /path/to/working/git/big-repository
git pull dev master
git svn rebase

But the rebase fails because of some merge errors that appear to happen because all submodules had an identical file in their top-level (pom.xml)

Is there any any way I can import the git repository into svn keeping the history?

oschrenk
  • 4,080
  • 4
  • 22
  • 25

1 Answers1

0

Hopefully someone else will provide a more graceful answer, but if the problem really is this one conflicting file you could probably use git filter-branch to remove the file from the project history.

This page has an example.

larsks
  • 277,717
  • 41
  • 399
  • 399
  • I don't think that's it. Each submodule has the same layout (with `pom.xml` in its root directory) but they ended up in different directories in the big-repo. Somehow though when rebasing for svn they end up in the same directory. I assume this is because of the multiple initial commits. – oschrenk Apr 26 '12 at 09:51