Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Created December 24, 2018 15:54
Show Gist options
  • Save peteristhegreat/e1e6d412aca33427ddcf9a36711aa04e to your computer and use it in GitHub Desktop.
Save peteristhegreat/e1e6d412aca33427ddcf9a36711aa04e to your computer and use it in GitHub Desktop.
Open Selected Version in MacOS when SourceTree refuses to work properly.
#!/usr/bin/env bash
#extension=${FILE#*.}
mytemp=$(mktemp /tmp/XXXXXXXX.$(basename $FILE))
EDITOR=$(git config --get core.editor)
git show $SHA:$FILE > "$mytemp" && "$EDITOR" "$mytemp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment