20

I know what are bugfix, hotfix and feature branches.
But the thing that I can't grasp is support command as git flow support start <version> <branch>

could someone explain this command with a simple scenario?

Mehrdad Shokri
  • 1,974
  • 2
  • 29
  • 45

1 Answers1

28

Here's the quoted definition from https://gitversion.net/docs/git-branching-strategies/gitflow-examples

Support branches are not really covered in GitFlow, but are essential if you need to maintain multiple major versions at the same time. You could use support branches for supporting minor releases as well. If you are just supporting the majors, then name your branch support/<major>.x (i.e support/1.x), to support minors use support/<major>.<minor>.x or support/<major>.<minor>.0. (i.e support/1.3.x or support/1.3.0)

The point here is to have a branch which needs to be supported for some time in parallel to develop/master.

Tiago Martins Peres
  • 14,289
  • 18
  • 86
  • 145
ikryvorotenko
  • 1,393
  • 2
  • 16
  • 27
  • should I add support branches when I'm migrating from a major version to another? suppose my current version is 8.0 and I have some customers using version 6.0. and there is a hotfix that should be addede to 6.0 but I don't have any support version for that. What can I do then? – Mehrdad Shokri Jun 17 '16 at 19:51
  • 2
    it looks like the support branch is what you need here. it allows you to maintain multiple versions at the same time. note, that `git flow support start ` requires to have a original_commit - a commit from master branch. Having this you could create a hotfix branch and create a merge request to merge it to 6.0 (support) and 8.0 (master) branches – ikryvorotenko Jun 17 '16 at 19:58
  • @kryvorotenko you didn't answer my question did you? I asked that weather I should have created that support branch long before providing the hotfix for version 6.0. – Mehrdad Shokri Jun 17 '16 at 20:06
  • @Mehrdad you can create them at any time. even if you're far away from the commit which releases 6.0 version, you can create the support branch from that commit and apply a hotfix there. – ikryvorotenko Jun 17 '16 at 20:10
  • just a quick question. suppose I'm on version 8.0 and I want to provide a hotfix for 6.0 but I don't have a support branch. How do I create that branch? – Mehrdad Shokri Jun 17 '16 at 20:44
  • 2
    @Mehrdad let's say you have a commit hash 12345, which you want to use as a start point for your 6.0 version. So this may create a support branch for you: `git flow support start support/6.0 12345`. From the other hand, you can do it with just git: `git branch support/6.0 12345` – ikryvorotenko Jun 19 '16 at 19:19
  • I wonder what would happen after you finish a support branch. Is it merged somewhere? Or is it just deleted, meaning you dropped support for that version? Would deleting the branch mean you lose that code? – geekley Sep 25 '18 at 15:15
  • The command suggested by @ikryvorotenko would actually be `git flow support start 6.0 12345`. Instead of a commit hash other *refs* can be used, e.g. a tag like `git flow support start 6.0 v6.0`. – TNT May 17 '21 at 09:09