I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it.
How to find the first tag that contains a git commit
git
git
I have the SHA ID of a commit that I am interested in and would like to know how to find the first tag that contains it.
Best Answer
As previously stated, this can be done with
git describe
. In your particular case, however, you may find it more convenient to rungit name-rev --tags --name-only <SHA>
, which outputs exactly what you want. See git-name-rev(1).