Hotfixing with an open release branch while this release is currently tested

We are using gitflow and currently have an open release branch.

The release at A is currently on the test-system to get tested by key-users. In the meantime we need to release an urgent hotfix. Commonly we pull out a branch of master (so the latest live-system release) and merge it into development and master. If we would do this here, we would not have the hotfix in the currently open release.

So what do I have to do at the point marked as "?" in the illustration? Assume that the hotfix is ready to get merged.

1 answer

You might merge it to master and develop as you used to do - and cherry-pick the hotfix commit(s) to be merged into your branch release as well. Doing so the hotfix will be available in all of your branches - and you are sure that only the hotfix related changes are merged into your branch release.

If you want to have all changes from branch hotfix within branch release - just do a plain merge.

Your question is rather a general git best-practice question than a Bitbucket related question.


Many thanks Johannes! Unfortunately, the provided link is broken. 

Ooops - cut'n paste error. I've corrected the link.

Another additional link, as your name sounds german: wink

Additional remark: Even if you are using gitflow, you are still free to merge your changes to anywhere you want.

For example: if you don't want to have the hotfix on your develop branch, just merge it manually to your master branch and to your branch release. After this you can delete your branch hotfix. Doing so, you left the straight git-flow path ... but who cares?

If you don't want to merge all changes from your hotfix branch to your relase branch you should do a git cherry-pick, to select the commits you want to be available on your release branch.

In the most cases a prerequisite of cherry-pick are good structured commits, where each commit only contains single, comprehensive changes.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables ROLLBAR_ACCESS_TOKEN...

186 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you