Commit hash in python using subprocess.check_output()

280 Views Asked by At

I wish to get the current commit hash in my python script using the following command:

subprocess.check_output(['git', 'rev-parse', 'HEAD'])

It returns an empty string for some reason. When run on another system it seems to return the commit hash as expected. Does anyone know why?

0

There are 0 best solutions below