Skip to content

Instantly share code, notes, and snippets.

@philippstroehle
Created December 4, 2013 07:12
Show Gist options
  • Save philippstroehle/7783546 to your computer and use it in GitHub Desktop.
Save philippstroehle/7783546 to your computer and use it in GitHub Desktop.
def git_version():
from subprocess import Popen, PIPE
gitproc = Popen(['git', 'rev-parse','HEAD'], stdout = PIPE)
(stdout, _) = gitproc.communicate()
return stdout.strip()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment