I am trying to determine the best way to finish-off a release branch in git. I would like to take it so we could easily go back if we need to. So when I do my merge to the develop branch I create a tag and push it to the remote like so:
Tag this release
$ git tag -a "v1.6" -m "Release v1.6"
Push to remote
$ git push origin develop --follow-tags
Which appears to work great. However, I also need to merge to master and would like to take it there for the same reason. When I attempt to create the tag on release I obviously get a conflict. So, up to now I have been creating a tag like so:
$ git tag -a "v1.6-master" -m "Release v1.6"
This works fine but it seems like there should be a way to just create a tag and be able to checkout that tag on whatever branch you happen to be on. I feel like I am missing something essential.
Yes! The difference between a branch name and a tag name is that a branch name is expected to move, and git will move it automatically in that "on a branch" case.
Master is a permanent branch which always reflects a production-ready state. So yes, it is for ready-product which can be downloaded on the market by user. Release is a temporal supporting branch to support preparation of a new production release.
With Git, it is a commit, not a branch, that gets tagged. Depending on your workflow, the same commit could exist in both master and develop. However, given you have those two branches, it is likely that a (merge) commit to master signifies a release. In that case, the proper thing to do would be to tag that merge commit to master.
Sounds pretty similiar to git flow. Did you have a look on it already?
The first two are the original branching model. The last one is the current development that you can also find in your favorite linux repository. It adds support branches for older versions that you need to support obviously.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With