On http://nvie.com/posts/a-successful-git-branching-model/ it says:
Release branches are created from the develop branch. For example, say version 1.1.5 is the current production release and we have a big release coming up. The state of develop is ready for the “next release” and we have decided that this will become version 1.2 (rather than 1.1.6 or 2.0). So we branch off and give the release branch a name reflecting the new version number:
$ git checkout -b release-1.2 develop Switched to a new branch "release-1.2" $ ./bump-version.sh 1.2 Files modified successfully, version bumped to 1.2. $ git commit -a -m "Bumped version number to 1.2" [release-1.2 74d9424] Bumped version number to 1.2 1 files changed, 1 insertions(+), 1 deletions(-)
Now I have a number of issues with that:
- The develop branch is still at 1.1.5; when will this be updated? Does it make sense that the develop branch is "behind" a release branch in terms of version numbers at a certain moment in time?
- So say I increase my version numbers before creating the release branch. If I do so, I have the same version number on dev and release branch until the next release, which I think makes more sense. What are the reasons for bumping version numbers after creating the branch?
Even then, actually I want my development branch to have a version number that clearly indicates that this is a development version (because no one who finds a generated "myproject-1.2.jar" file somewhere should consider for a second to run this jar file in a production environment). So from the moment I create the release branch I would like the version numbers to reflect "this is version 1.2.0" and "this is a development version based on 1.2".
Unfortunately, when creating the release branch, bumping the version number to "1.2" there and to something like "1.2+dev" on the development branch will result in a conflict every time I will try to merge changes from the release branch back into develop. Do you have any advice how to get this kind of versioning in place using git?
It seems like the following workflow is actually able to realize the desired versioning in git:
<last-release>+dev
.<next-release>
and commit.releases/v<next-release>
from develop.<next-release>+dev
and commit.releases/v<next-release>
branch into master and tag it.This way,