hub: make sure build scripts have access to Git data

The version script depends on having Git data to determine a version.

Closes #35258.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>