Remove `git rev-parse` check for valid .git directory

Instead pass `—git-dir=.git` to all git commands to ensure that the
command will only affect the local directory.
Error if git executable is not available