Skip to content

Instantly share code, notes, and snippets.

@atabary
Created December 18, 2012 03:13
Show Gist options
  • Save atabary/4324704 to your computer and use it in GitHub Desktop.
Save atabary/4324704 to your computer and use it in GitHub Desktop.
Simple fabric task that returns the current revision of a git repository.
from fabric.api import local
def current_revision():
revision = local("git log -1 | grep commit | awk '{ print $2 }'", capture=True)
print 'current revision: %s' % revision
return revision
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment