#27305 Better error reporting around git

This minor tweak adds better error reporting when git is missing from the system or when a git command fails.
is it worth caching if this is successful or not so that it only has to run git --version once per toolkit command regardless of the number of git calls?