7

In our project we are following repo model as per http://nvie.com/posts/a-successful-git-branching-model/ .

I had been adding features into the develop branch until now, however now our project has created a release branch and I need to add a fix on that release branch. From what I have read , adding a hotfix will add the fix to my master branch and not the release branch. So how do I add a fix on my release branch ?

Unknown
  • 5,722
  • 5
  • 43
  • 64
jay
  • 791
  • 8
  • 20

2 Answers2

10

One of the major points of release branches is to allow for minor bug fixes. So while the release branch is active, you can make fixes directly on the release branch.

After the release branch is finished, i.e. the release has been made, it is merged to master. After that commits should no longer be added to the release branch. Rather, urgent bugfixes done after a release are hotfixes, and should be merged to master. (Non-urgent bugfixes can be created as features, merged to the develop branch and released later)

Conceptually the release branch is "dead" after the release has been made. Only master and develop branches live on continuously.

You are of course free to have a different process, but then you are not strictly following the git-flow model.

Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158
0


thinking release branch different from master branch is making an issue here :).

Normal Flow is:
develop -> staging -> master. Then you make a release and tag it (v0.1)

Hot fix flow is:
A -> B-> C

A : develop -> staging -> master (v0.1)


B : master -> release branch (It is a branch off from master)
(here we apply hot fix and make a release, tag it here) (v0.1)


C : release branch -> develop (merging those hot fix back to develop)

Cycle starts again as Normal Flow with new version number(v0.2)

develop -> staging -> master.

So master branch always stays intact. The only change is release branch comes between master branch and develop branch.
Tip is every time you apply a hot fix to release branch or master branch, the immediate next step is to merge those changes back to develop

Hope this helps :).

Narasimha
  • 759
  • 6
  • 8