SourceTree git-flow: Hotfix-Branch merges into branch develop only??
Asked by Johannes Kilian:

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](http://nvie.com/posts/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 ...


Answers:
author: Johannes Kilian
body: The culprit seems to be usage of **--no-commit** option

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


author: stevestreeting
body: 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:

![](http://content.screencast.com/users/sjstreeting/folders/Jing/media/4283a5b4-1f76-49c8-a44a-144dca1dfb42/sthotfixmerge.png)

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.

comments: author: Johannes Kilian
body: That's how it looks on my system after finishing *hotfix*

![Situation afert finishing hotfix](http://imageshack.us/a/img838/1852/sourcetree2013051707365.png)

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'*   

<br />

*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

```


author: stevestreeting
body: Interesting, because the git-flow output says this:

```
- Hotfix branch has been merged into 'master'- The hotfix was tagged 'BDBInfo2_BCD'&lt;br&gt;- 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?


author: Johannes Kilian
body: 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>)


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


author: Johannes Kilian
body: 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>)... :-(


Tags: git-flow