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

Kai August 24, 2016

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

0 votes
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.
August 24, 2016

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.

 

Kai August 24, 2016

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

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.
August 24, 2016

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

Another additional link, as your name sounds german: https://www.ralfebert.de/git/cherry-pick/ wink

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.
August 24, 2016

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

Atlassian Community Events