I'll preface this with I'm fairly new to git, having migrated from a SVN background. I've been using a git-flow based workflow and tagging releases with a numerical standard like v0.2.0
Tonight I went to deploy from my sandbox to main site and noticed that if I did a git checkout -b tags/v0.2.2
that it actually pulled that latest commit from the master branch. But if I check out the same tag in a detached head state i.e. git checkout /tags/v0.2.2
it checks out from master based on the proper commit.
[ calllog]$ git branch
* master
[ calllog]$ git checkout tags/v0.2.2
Note: checking out 'tags/v0.2.2'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at d5b4c5e... Merge branch 'feature/password' into develop
[ calllog]$ git describe
v0.2.2
[ calllog]$ git checkout master
Previous HEAD position was d5b4c5e... Merge branch 'feature/password' into develop
Switched to branch 'master'
[ calllog]$ git checkout -b tags/v0.2.2
Switched to a new branch 'tags/v0.2.2'
[ calllog]$ git describe
v0.2.4-5-gb2cfa6a
This behavior only seems to happen when checking out a tag that is not the most current
[calllog]$ git tag
v0.1.1
v0.1.2
v0.1.3
v0.1.4
v0.2.0
v0.2.1
v0.2.2
v0.2.3
v0.2.4
Am I missing something or is this normal behavior? What's the recommended paradigm for promoting from a git-flow tag based workflow into your production environment?