Skip to content

Instantly share code, notes, and snippets.

@geoff-nixon
Forked from katta/gitdiff-svnpatch.sh
Last active May 30, 2016 14:23
Show Gist options
  • Save geoff-nixon/7153630 to your computer and use it in GitHub Desktop.
Save geoff-nixon/7153630 to your computer and use it in GitHub Desktop.
Use 'git diff' to produce subversion style patches.
#!/bin/sh
svnstyle(){ sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" -e 's/@@\(.*\)@@.*/@@\1@@/g' ;}
DIFFPARAMS='--no-prefix --ignore-space-at-eol --minimal'
git diff $DIFFPARAMS "$@" | svnstyle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment