How do I create a git component patch from svn version containing binary file changes?

I want to apply diff from SVN version to some directory. But this diff contains changes in binaries (.png images). I am trying to use git -apply, for example:

svn diff --force --git -r 1:2 <remote url> | git apply --binary -p4 -

      

But I am getting an error expected /dev/null on line 5

.

What is the correct way to achieve my goal?

+3


source to share


2 answers


The real problem is svn diff

, since it doesn't generate diff very well. The solution looks like this:



svn diff --no-diff-deleted --show-copies-as-adds --force --diff-cmd /usr/bin/diff -x -au -r 1:2 <remote url> | patch -Np4

      

0


source


Why do you want to apply the patch via git? Just run

svn diff --force -r 1:2 <remote url> | patch -p4 -i ~/patch.diff

      



And then commit the changes caused by this command.

0


source







All Articles