- Create hotfix-branchfromrelease
- Commit to hotfix-branch
- Merge hotfix-branchinto bothreleaseanddevelop
- Simple; everybody understands it
- releaseand- develophave different histories due to differing merge parents (not really an issue if you re-branch- releaseevery time)
- Potential conflicts when merging into develop
- Risk of merging release-only commits (e.g. version bumps) into develop
- Create hotfix-branchfromdevelop
- Commit to hotfix-branch
- Merge hotfix-branchintodevelop
- Rebase (or cherry-pick) hotfix-branchontorelease1
- releaseand- develophave the same histories (- releaseis fast-forwarded)
- No risk of merging unwanted commits into releaseordevelop
- Many people are uncomfortable with rebase (although in this case the rebase is non-destructive)
1 Using something like:
$ git rebase --onto hotfix-branch develop release
First, rewinding head to replay your work on top of it...
Fast-forwarded release to hotfix-branch.
Thanks for the post. I guess the git command should be fixed to:
so that
hotfix-branchcan be transplanted torelease