#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.
This should just be in a :raises: section.