Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2013

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
Answer accepted
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 26, 2013

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

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

0 votes
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 15, 2013

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.

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2013

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

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 16, 2013

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?

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 20, 2013

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)

stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2013

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

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 22, 2013

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
TAGS
AUG Leaders

Atlassian Community Events