SourceTree git-flow: Hotfix-Branch merges into branch develop only??

Using git-flow feature within Sourcetree with standard configuration of git-flow (branch naming conventions ...)

What I did:

  1. Branch develop and branch master are on the same commit at the beginning
  2. Created a Hotfix Branch via git flow-Button (
    This happened on HEAD of branch "release" -> OK
  3. fixed on hotfix branch ....
  4. Finished hotfixing via git flow-Button ->
    a. Hotfix-Branch was deleted -> OK
    b. merge to branch "develop" took place -> OK
    c. switch to branch "develop" took place automatically (active branch is now "develop")
    d. merge to branch "master" took NOT place -> NOK (master is unmodified)
    e. Head of Branch 'master' is tagged with the provided tag (via git-flow dialog box)

What I expected according A successful Git branching model:

  • Hotfix has to be merged to branch develop as well as to branch master. Head of Branch "master" should carry the given Tag.

=> This does not happen within sourcetree: merge from branch hotfix to branch master does not take place automatically!!

I see the same behaviour with using Release-Branches via git-Flow Button within SourceTree: Starting point of creating branch "Release" is here HEAD of branch develop (that's correct for release branches).

Finishing the release branch only merges to branch develop - merge to branch "master" does not take place ...

What's wrong?

Using: SourceTree 0.9.2.3, Win7 64bit Ultimate ...

2 answers

1 accepted

0 votes
Accepted answer

The culprit seems to be usage of --no-commit option

Created a issue: https://jira.atlassian.com/browse/SRCTREEWIN-606

Hmm, that's odd because I've run a number of tests here and my hotfix branches always merge to both master and develop. Here's a screenshot of my latest hotfix test:

This happened automatically when finishing the hotfix. There was an issue with using the 'Rebase' option when finishing a feature which caused an issue, this is fixed for 0.9.3 which will be released soon.

Can you try checking the 'Show Full Output' box and see if there's anything in the output that might explain it? All SourceTree does is call git-flow anyway.

That's how it looks on my system after finishing hotfix

Situation afert finishing hotfix

As you can see, master does NOT contain the hotfix ... The tag "BDBInfo2_BCD" was automatically set by finishing hotfix (I provided Prefix "BDBInfo2" at git-flow setup within Sourcetree)

As I said: the same happens, with finisihing release branches

Output on Hotfix-start:

sh.exe C:\Users\jok\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow\git-flow hotfix start BCD
Branches 'master' and 'origin/master' have diverged.

And local branch 'master' is ahead of 'origin/master'.

Switched to a new branch 'hotfix/BCD'


Summary of actions:
- A new branch 'hotfix/BCD' was created, based on 'master'
- You are now on branch 'hotfix/BCD'

Follow-up actions:
- Bump the version number now!
- Start committing your hot fixes
- When done, run:

git flow hotfix finish 'BCD'

Output on hotfix finish:

sh.exe C:\Users\jok\AppData\Local\Atlassian\SourceTree\gitflow_local\gitflow\git-flow hotfix finish -f C:\Users\jok\AppData\Local\Temp\cfkz5dc5.s3y BCD
Branches 'master' and 'origin/master' have diverged.

And local branch 'master' is ahead of 'origin/master'.

Branches 'develop' and 'origin/develop' have diverged.

n/develop'.

Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)


Switched to branch 'master'

Automatic merge went well; stopped before committing as requested

M .gitignore
Your branch is ahead of 'origin/develop' by 3 commits.
(use "git push" to publish your local commits)

Switched to branch 'develop'



Merge made by the 'recursive' strategy.

.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


Deleted branch hotfix/BCD (was 0b806d4).



Summary of actions:
- Latest objects have been fetched from 'origin'
- Hotfix branch has been merged into 'master'
- The hotfix was tagged 'BDBInfo2_BCD'
- Hotfix branch has been back-merged into 'develop'
- Hotfix branch 'hotfix/BCD' has been deleted

Interesting, because the git-flow output says this:

- Hotfix branch has been merged into 'master'
- The hotfix was tagged 'BDBInfo2_BCD'<br>
- Hotfix branch has been back-merged into 'develop'
- Hotfix branch 'hotfix/BCD' has been deleted

So it's certainly claiming that it merged into master. Do you have any settings in your .gitconfig (globally or in this repository) related to merging?

Good point - yes I do have:

[branch "master"]
	mergeoptions = --no-commit --no-ff

That's because I want to give the commits my own comments - and not the automatically generated ones ...

I use --no-ff because it makes the history is easier to understand (in my eyes), and makes it easier to revert a group of commits. (see: http://stackoverflow.com/questions/2850369/why-does-git-use-fast-forward-merging-by-default)

Can you try removing those options just while testing the finish operation to eliminate that as a potential cause?

After updating Sourcetree 0.9.2.3 -> 0.9.3.0 git_flow does not work anymore. Will be back when I've fixed this issue (see: https://answers.atlassian.com/questions/171852/gitflow-broken-on-v-0-9-3-0)... :-(

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 01, 2018 in Summit

Summit 2019 is going to Las Vegas

You asked we answered - Summit 2019 registration is now open! Can you believe Atlassian Summit hasn’t been to the US since 2017? Now is the time to get ready for an event to remember! Our biggest u...

284 views 6 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you