Skip to content

Instantly share code, notes, and snippets.

@speechkey
speechkey / git-svn-diff.sh
Created July 11, 2012 19:27 — forked from nmacinnis/git-svn-diff.sh
Windows and TortoiseSVN-friendly modifications
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'`
@speechkey
speechkey / gitdiff-svnpatch.sh
Created July 11, 2012 19:26 — forked from katta/gitdiff-svnpatch.sh
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