2

Doing experimental learning of git flow for my new project.. I noticed the following:

The following scenarios:

  1. Normally git-flow workings:

    git flow hotfix start 1.1.2

    Will create a branch based on master and when done merges with master and develop.

  2. Branching based on another branch

    git flow hotfix start 1.1.3 support/1.x

    But then the hotfix created based on support branch will merge back into that support branch and not back into develop nor master but will be tagged when finished.

Problem

If my master branch is currently in v3.2.0 but the hotfix was for an issue in a code section introduced in v1.1 but still relevant and used in the current development branch, how do I go about merging them together?

The reason for this question is that some clients would need long term support of a specific older version even if your newer version is more superior.

Possibly solution but not( using SourceTree)

Atlassian SourceTree always only merge finish hotfix with master and develop but never with the support branch that is needed by clients (tested thrice)

Sojimaxi
  • 485
  • 1
  • 10
  • 17

1 Answers1

1

If my master branch is currently in v3.2.0 but the hotfix was for an issue in a code section introduced in v1.1 but still relevant and used in the current development branch, how do I go about merging them together?

Since you won't merge an hotfix branch (where the issue was solved) into master, you can cherry-pick the relevant commit back to master.

log view (Cmd-2), just select one or more commit lines (Cmd-click or Shift-click multi-selects), then right-click and select 'Cherry pick'.

https://answers.atlassian.com/download/attachments/15697265/Capture.PNG?version=1&modificationDate=1431431872796&api=v2

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks it did what I wanted. – Sojimaxi Jul 30 '16 at 12:27
  • @Sojimaxi Well done. This is appropriate when you know you won't ever merge the source branch to the destination (the one to where you cherry-picked). A merge would duplicate that cherry-picked commit, which isn't good. – VonC Jul 30 '16 at 12:28