the question says it all. Assume you have a branch called dev but you are currently either in a detached HEAD (case of some CI/CD pipelines) or in another branch. How do you get the most recent tag for that specified branch? By recent I mean the tag attached to the latest commit. '
in How can I get the latest tag name in current branch in Git? we find ways to get the lates tag on the current branch, or the lates tag across all branches. I want the latest tag of a different branch