Check whether we are in a git work tree before doing anything else.