简体   繁体   中英

How to have different tag than master branch in local git branch

I want to have different tags for my master and release branches. I was wondering how to do this?

I have a git master branch with the tag 2.2.2-crown . When I created a release branch, it seems the release branch inherited the tag from my master branch.

$(master): git tag
2.2.2-crown

I created one branch,

$git checkout -b release_branch
$git tag v3.1
$git tag
2.2.2-crown  <--------------I don't want this tag in my release branch
v3.1        

I just want to have only release tags not master tag.

git tags are not per branches. Tags are just refs, like branches are, that point to one of the commits of the git history.

You'd better name your tags 'release/v3.1'.

And the git tag command will always list them all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM