Junio C Hamano | 2 Jun 2012 00:00
Picon
Picon
Favicon
Gravatar

Re: Getting the commit that corresponds to a specific annotated tag

Adam Mercer <ramercer <at> gmail.com> writes:

> For some porcelain I'm writing I need to determine the commit that
> corresponds to a given annotated tag, so far I have the following:
>
> $ git cat-file tag <tag_name> | grep object | awk '{print $2}'
>
> Is there already some pluming that performs this task?

I think you want

	git rev-parse $tag^{commit}

It's kind of scary, though.

Gmane