Exibindo o hash do último commit em repositório git qua 15 janeiro 2020 No shell utilizando comando git: 1 2 3$ export LAST_COMMIT=$(git rev-parse HEAD) $ echo ${LAST_COMMIT} 132a333e8b798c6a6b7defaad21b47ee3ce7a3aa Em Python puro com o módulo GitPython: 1 2 3 4 5>>> import git >>> repo = git.Repo(".") >>> last_commit = str(repo.head.commit) >>> print last_commit 132a333e8b798c6a6b7defaad21b47ee3ce7a3aa Comentários Please enable JavaScript to view the comments powered by Disqus.
Comentários