Skip to content

Instantly share code, notes, and snippets.

@jojonki
Created June 24, 2018 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jojonki/94adfc293e08528e94b8fbec56370683 to your computer and use it in GitHub Desktop.
Save jojonki/94adfc293e08528e94b8fbec56370683 to your computer and use it in GitHub Desktop.
Get a current Git revision in python
import subprocess
rev = subprocess.check_output(['git', 'describe', '--always']).strip().decode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment