4

What are the best practices of merging hotfix branch into master/develop?

Do I need to merge it into both branches

hotfix → master
hotfix → develop

or merge to master and then to develop after.

hotfix → master → develop
Vladimir Nani
  • 2,774
  • 6
  • 31
  • 52

1 Answers1

0

You can merge your hotfix branch into both master and develop (according the the popular successful git branching model)

git checkout master
git merge --no-ff hotfix

git checkout develop
git merge --no-ff hotfix

You can then delete your hotfix branch safely.

Or use git cherry-pick <hotfix-commit-hash> on both develop and master branch. Cherry-picking is the easiest way to bring a single/few commit(s) into branches.

RaphDG
  • 1,351
  • 10
  • 17