From your description it sounds like there were only a few commits in Subversion that you want to pick up. The most direct method is to extract and apply each patch manually, which I'll outline here. First, you can use the svn diff
command to extract the diffs (a "diff" is functionally equivalent to a "patch").
svn diff -r 101:102
This will show the diff between revision 101 and 102. You can redirect this output into a file for use in the next step:
svn diff -r 101:102 >r102.patch
In the Git repository, take the diff from the previous step and apply it using the patch
program:
patch -p0 <r102.patch
The -p0
tells the patch
program how to look for the file(s) named in the patch. Finally, commit the changes to Git:
git add -u
env GIT_AUTHOR_NAME="new name" GIT_AUTHOR_EMAIL="new email" git commit
The GIT_AUTHOR_*
environment variables allow you to preserve the original author information, which may be useful for history maintenance.
The above should work easily enough for text files, but if any changed files in Subversion happen to be binary files, you'll have to use a slightly different technique (Subversion will refuse to produce a useful diff in this case). Instead of extracting patches and applying, just copy the file(s) from each Subversion revision to the Git repository before committing. This would actually work just fine for text files too, if you prefer.