Skip to content

Instantly share code, notes, and snippets.

@katta
Created June 16, 2011 08:10
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save katta/1028871 to your computer and use it in GitHub Desktop.
Save katta/1028871 to your computer and use it in GitHub Desktop.
Converts git diff to svn patch format
git diff --no-prefix | sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" --ignore-space-at-eol > changes.patch
@rambattu
Copy link

In case we already have a diff which got generated without "--no-prefix" option, here is a script git-diff-to-svn-path.sh that is inspired from this script gitdiff-svnpatch.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment