1 2 3 4 5 6 7 8 9
#!/bin/sh res=$(git rev-parse --is-inside-work-tree 2>/dev/null) if [ "$res" = true ]; then exit 0 else exit 1 fi