Nicholas's accepted answer works fine unless a) the binaries exist in diff or b) you work in windows Git and have directories with spaces. To get this solution, I had to add a Git diff nested command to ignore the binaries and sed command to avoid spaces. It's a little 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
... Feature123.patch patch file will be created with the differences between the merge base of the master server and the Feature123 branch.
Leandro Gomez Jun 16 '17 at 3:28 2017-06-16 03:28
source share