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
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
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.