How to apply SVN diff to Git?

Andriy Drozdyuk picture Andriy Drozdyuk · Mar 18, 2009 · Viewed 24.6k times · Source

I have my projects in 2 repositories. One under SVN and one under Git. Whenever I change something in SVN I want to do the same thing to the Git repository.

Say I make a change to SVN repository, producing revision 125. How would I apply these same changes to my Git repository (assuming my Git repository is up to date with revision 124).

Thank you.

Answer

Andriy Drozdyuk picture Andriy Drozdyuk · Mar 18, 2009

What I actually did/looking for was:

cd /path/to/svn/repo
svn diff -r 125 > /tmp/patch.diff
cd /path/to/git/repo
patch -p0 < /tmp/patch.diff