/githead

Simple utility for getting the current git commit hash (HEAD)

Primary LanguagePythonBSD Zero Clause License0BSD

githead

PyPI - Python Version Liberapay Patrons GitHub Sponsors

Simple utility for getting the current git commit hash (HEAD).

Installation

pip install githead

Basic usage

from githead import githead

githead() # -> 'bca663418428d603eea8243d08a5ded19eb19a34'

# defaults to '.git' directory but can be changed:
githead('path/to/.git')