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
@speechkey
speechkey / gist:2647963
Created May 9, 2012 18:54
BASH/Ask for confirmation
read -p "Are you sure? " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
@speechkey
speechkey / gist:2585924
Created May 3, 2012 14:15
Remove ACL permissions from HFS+ file
chmod -R -a# 0 file_or_folder_name
@speechkey
speechkey / gist:2510037
Created April 27, 2012 15:11
Merge git conflict with Sublime Text 2
Find what: \n<<<<<<< HEAD((.*\n)*?)=======(.*\n)*?>>>>>>>.*\n
Replace with: \1