Is there any way to get a patch created with git format-patch to be svn compatible so that I can submit it to an svn repo?
I\'m working off an svn repo on github and
The accepted answer provided by Nicholas works fine, except when a) binary files exist in the diff or b) you are working in windows Git and have directories with spaces. To get that resolved I had to add a nested git diff command to ignore binaries and sed command to escape the spaces. It's a bit cumbersome to write, so I created an alias:
[alias]
svnpatch = "!f() { git diff --name-only --no-prefix master...$1 | grep -Ev \"\\.sdf|\\.Doc|\\.dll|\\.zip|\\.exe\" | sed 's_\\s_\\\\\\\\ _g' | xargs git diff --no-prefix master...$1 > $1.patch; echo "Created $1.patch"; }; f"
If you then type:
git svnpatch Feature123
...a patch file Feature123.patch will be created with the differences between the merge base of branch master and branch Feature123.