fix order dependency in remote git caching

Also add more logging.