I know you can get the latest commit natively with Hugo. As for the history it might need a script to grab that from the git log, then put it in a manifest, under data, to then access later in templates.
This is something I made before it was baked in to Hugo.