How can i work on more than one hotfix at a time in sourcetree?
Asked by Jake Bishop:

I have a few bugs that i need to fix. Some of them involve some team collaboration so the hotfix branches will be pushed to remote. However, if i attempt to start more than one hotfix sourcetree gives me the following message:
> git hotfix start fix-a-bug-2  
> There is an existing hotfix branch (fix-a-bug-1). Finish that one first.  
> Completed with errors, see above

How can i create multiple hotfixes? Or if this is not allowed, what is a good work flow to deal with such situations?


Answers:
author: stevestreeting
body: This is unfortunately how git-flow works (that message is from git-flow itself). Why do you need more than one hotfix branch? The assumption is that if you're doing hotfixes, then there's just one release which you'll be patching, and you'll do it asap so there's not need to split them into multiple branches. If you're collaborating, you can just collaborate on that one hotfix branch. the assumption being that all the fixes here will be much smaller than the new features going back into develop, and therefore they don't really justify their own branches for each fix.

I guess if you really needed to, you could manually create additional fix branches off the hotfix branch (without using the hotfix prefix to avoid confusing git-flow), and merge those back into the hotfix branch before closing it. git-flow doesn't have a workflow for that though, so you'd have to organise that manually before using git-flow to close off the hotfix branch itself. This feels overkill to me but it's probably doable.

comments: author: Jake Bishop
body: I guess it just feels nicer to have a different hotfix branch for each bug that needs to be fixed. Also, if there can only be one hotfix, why does source tree offer a drop down selection for "Hotfix Version" when i want to finish the hotfix?


author: Jake Bishop
body: i'll cross my fingers. thanks for the info!


author: stevestreeting
body: Because I based the dialogs on the feature workflow originally and didn't realise until later that git-flow didn't allow more than one active hotfix/release - I now call it 'room for future expansion' in case they start allowing it later ;)


author: Eslam Mahmoud
body: But there are some cases when hotfix still in review and you need to start another one

thin you finish one by one and merge master into the one you are about to finish to be up to date with the latest change for the other hotfixes


author: Nikolas
body: I really don't like this behavior with Sourcetree. I was looking a new alternative (I'm currently using Smartgit) but this totally stop me from using Sourcetree.

1. You can be working in one hotfix and while someone review your code you need to start a new hotfix
2. You can be working in one hotfix and suddenly a more important bug arrived, so you have to create a new hotfix
3. You can be working in one hotfix, but someone else will continue the work (so you need to push your changes) and you will work in a new hotfix


author: wilkerce
body: 1. From master, create a new branch , manually, named hotfix/\<your_name\>
2. Now, you have another hotfix branch
3. Close them , normally by git flow, the new code will be merged to master and develop.

That?s the way I do for years... and works for me.

thanks.


author: Nikolas
body: I solved my problem with this configuration:

    git config --add gitflow.multi-hotfix true?

comments: author: Rafael Braga
body: This should be the top voted answer! Thank you!


author: zulhfreelancer
body: It works. Thanks!


author: artur
body: Great!


author: Adam Morgan
body: Superb, hoping to use this soon!


Tags: hotfix

process