get short sha of commit with gitpython
get short sha of commit with gitpython Question: The long SHA can be gotten like below: repo = git.Repo(search_parent_directories=True) sha = repo.head.object.hexsha Or, in git 3.1.7: sha = repo.head.commit.hexsha How about short one? (short SHA is decided by the scale of the repo, so it should not be like sha[:7]) Asked By: Kentaro Wada || …