After git-flow, how should you handle the patch from an earlier version?

If you try to follow the git-flow branching model, here and here , how you should deal with this situation:

You have released versions 1.0 and 2.0. Then you need to make a fix for 1.0. You create a patch branch from the 1.0 tag and implement the patch. But then what?

You should usually team up to create and place a version 1.1 tag there. But you cannot combine 1.1 with a dot after 2.0 on master.

I think you could put the release tag in the patch branch, but that would create a persistent branch next to the wizard that would contain the release tag. Is it correct?

+76
git branch git-flow hotfix
May 05 '13 at 15:53
source share
4 answers

There seems to be a concept of "support" in a git thread. This is used to add a fix to an earlier version.

This stream contains more information , with these examples:

git checkout 6.0 git checkout -b support/6.x git checkout -b hotfix/6.0.1 

... make your correction, then:

 git checkout support/6.x git merge hotfix/6.0.1 git branch -d hotfix/6.0.1 git tag 6.0.1 

or using git flow commands

 git flow support start 6.x 6.0 git flow hotfix start 6.0.1 support/6.x 

... make changes:

 git flow hotfix finish 6.0.1 
+54
Oct 10 '15 at 9:20
source share

Interest Ask! The flow you are linking suggests that the master can track production. This only works if production versions are strictly growing. This is usually true for a website that has only one production version.

If you need to support multiple production versions, one branch to track production is not enough. The decision not to use the master to track production. Instead, use branches like release1 , release2 , etc.

In this approach, you may not even need a patch branch. You can fix the problem in the release1 branches. When the fix is ​​good enough, create a release1.1 tag on the release1 branch.

+27
May 05 '13 at 16:16
source share

git -flow assumes that you only support one release line at a time, conveniently tracking the wizard. If you support more than 1, you will need to modify the git -flow process to have several trackers for your individual releases that you support (master-1, master-2). You can continue to use the wizard to track the latest release line, in addition to or instead of a specific tracker for the most recent release line (wizard instead of wizard-2).

Unfortunately, any git -flow tool that you may be using will probably need to be changed, but hopefully you are fairly familiar with the git -flow process to handle this particular case directly with git commands.

+6
May 05 '13 at 16:21
source share

git config --add gitflow.multi-hotfix true This command seems to work for me!

0
Dec 20 '18 at 16:53
source share



All Articles