Search code examples
gitsvndiffgit-svn

Taking (patch) the delta from svn to git


We have a Gerrit repository which was in sync with similar svn repo till some point in time. Now gerrit is behind by 4 commits. I need to take those 4 commits from svn to gerrit.

I tried multiple options I found here.

What I tried:

cd to svn repo and

svn diff -r r844:r944> myfile.patch

(Is there any other way to get all changes after a particular revision r844? ) copied that patch to a common location and

patch -p0 < myfile.patch

But what happened was - the changes were applied, but the commit history was not copied. This change was showing as one commit in the git after I did git add, git commit locally.

Is there a way where we can replicate the commit history as well from svn to gerrit(the delta changes)


Solution

  • I think that you need to use svn diff with the --git option.