title: Discovering git branch from python script
body: <p>I have a python script.
  I need to access the name of the git branch from which I'm running the python script, through python, during runtime.
  Is there a way to do this?</p>
  <p>Edit:
  os.system(&quot;git rev-parse --abbrev-ref HEAD&quot;) outputs to the cli, I don't see how I would get access to it <em>from</em> python...</p>
  <p>I would like to have sth like <code>git_branch = &lt;python commands&gt;</code></p>