Merge svn repo with git repo

git, svn

Solution

I've faced something similar to deal with multiple releases from a SVN-based development. Here is a sketch of how I'd handle it:

# checkout the SVN source
$ svn checkout svn://svnversion/trunk
$ cd /into/svn/checkout

$ git init
$ echo ".svn/" > .gitignore
$ git add .gitignore; git commit -m 'Initial .gitignore'

# Now you have a master branch; create your import-svn branch
$ git checkout -b import-svn

# Add *everything* from the SVN checkout
$ git add -A
$ git commit -m 'Initial SVN'

# Now get the GIT developed stuff
$ git checkout -b import-git master
$ git remote add original-git /path/to/git-developed-repository
$ git pull original-git master         # or whatever branch your git developers used.

# Now you've got two branches 'import-svn' and 'import-git'; DIFF and MERGE as you please

# You don't need the remote anymore.
$ git remote rm original-git

I think that is about right.

Now you can think about merging. Something like the following would work if you considered the 'import-git' as the preferred baseline.

$ git checkout -b git-merge-svn import-git
$ git diff --name-status import-svn
$ git merge import-svn

You could also try a rebase like follows and then decide which you prefer:

$ git checkout -b git-rebase-svn import-git
$ git rebase import-svn

And compare the merge and rebase (should be identical, but you never know..)

$ git diff git-rebase-svn..git-merge-svn

Problem

I have the daunting task of merging a site with a ton of files between two teams. One team has been working on `git` and one using `svn`. Can I please get some help with the best way to go about this? What I am thinking is I will create a new bare repo ``` git clone --bare ~/dir gitversion.git ``` Then create a branch from there ``` git checkout -b import-svn ``` Then on that branch I will pull from svn ``` svn checkout svn://svnversion/trunk ``` Now on this branch I would rebase? ``` git rebase origin/master ``` Then switch back to master branch ``` git merge import-svn ``` I tried something like this but seemed to be getting nowhere. Never got any merge conflicts or anything which doesnt make sense. Can someone please show me a decent workflow to accomplish this?

Original source