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

How can i work on more than one hotfix at a time in sourcetree?

Jake Bishop November 18, 2012

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?

2 answers

1 accepted

0 votes
Answer accepted
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.
November 18, 2012

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.

Jake Bishop November 18, 2012

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?

Jake Bishop November 18, 2012

i'll cross my fingers. thanks for the info!

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.
November 18, 2012

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 ;)

Eslam Mahmoud
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 8, 2017

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

Nikolas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2018

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
wilkerce
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 12, 2018
  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.

Like # people like this
25 votes
Nikolas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 10, 2018

I solved my problem with this configuration:

git config --add gitflow.multi-hotfix true 
Rafael Braga November 20, 2018

This should be the top voted answer! Thank you!

zulhfreelancer March 2, 2019

It works. Thanks!

artur
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 2, 2019

Great!

Adam Morgan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 7, 2021

Superb, hoping to use this soon!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events