Skip to content

Instantly share code, notes, and snippets.

@sharplet
Created August 21, 2015 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharplet/cd3f4cab8e70768be110 to your computer and use it in GitHub Desktop.
Save sharplet/cd3f4cab8e70768be110 to your computer and use it in GitHub Desktop.
Disable git at the terminal, but still allow shelling out
#!/bin/sh
if [ -t 1 ]; then
echo LOL >&2
exit 1
else
real_git=$(type -a git | head -2 | tail -1 | cut -d" " -f 3)
exec "$real_git" ${*}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment