2

I am having difficulties understanding how to merge correctly hotfixes (in the git-flow sense) in SourceTree. The SourceTree website states:

Once you’ve made your changes, the hotfix branch is then merged back into both the master branch (to update the released version) and the development branch (to make sure the fixes go into the next release too)

But when I finalize a hotfix in SourceTree I get this:

Indeed Sourcetree did merge the hotfix into both master and develop but this apparently caused both those branches to diverge, which then forced me to merge develop into master again manually. The resulting structure is plain ugly.

Before the hotfix, both master and develop were on the same commit. Hence I expected that after the hotfix, SourceTree would merge both those branches with the hotfix branch through fast-forward, basically obtaining a simple layout like that: enter image description here

Here the hotfix "fixing more..." is visible just as a simple commit. Is there any option that would cause SourceTree to merge in a hotfix with such a simple fast-forward merge, basically moving ahead master and develop at the same time? Is there anything I may be missing aobut git or git-flow?

4

1 に答える 1

1

The original article that described git flow has the merges being done with git merge --no-ff. It sounds like SourceTree is doing the right thing.

Note that if you want fast-forward merges yourself, you can issue the commands manually, leaving off the --no-ff option.

于 2012-12-05T14:49:07.170 に答える