changeset

How to retrieve the hash for the current commit in Git?

亡梦爱人 提交于 2019-11-26 02:25:42
问题 I would like to retain (for now) the ability to link Git changesets to workitems stored in TFS. I already wrote a tool (using a hook from Git) in which I can inject workitemidentifiers into the message of a Git changeset. However, I would also like to store the identifier of the Git commit (the hash) into a custom TFS workitem field. This way I can examine a workitem in TFS and see what Git changesets are associated with the workitem. How can I easily retrieve the hash from the current commit