+1 vote
1 view
in Devops and Agile by (29.1k points)

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 work item field. This way I can examine a work item in TFS and see what Git changesets are associated with the work item.

How can I easily retrieve the hash from the current commit from Git?

1 Answer

0 votes
by (49.6k points)
edited by

To change arbitrary extended object reference into SHA-1, use the following example commands

git rev-parse HEAD

or

git rev-parse --verify HEAD

For more information please go through the following tutorial to get more info about git:

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 24, 2019 in Devops and Agile by chandra (29.1k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...