Reputation: 6016
Imagine a git repository that is structured as follows:
Main --------------------------------> \ Release o--------o \ / Hotfix o--
So hotfixes are developed off the Release branch, and in order to bring hotfixes into my Main branch, my previous pattern has been to use cherry pick merges. Now I'm questioning whether this is appropriate.
Would using regular merge to merge the Hotfix branch into the Main branch be more appropriate here? Are there any "gotchas" in either scenario?
Upvotes: 2
Views: 127
Reputation: 133008
I'd rebase my hotfixes onto the release branch and once in a while merge in the release branch into main, so main get the fixes as well.
Cherry picked commits should be avoided imo, since they produce extra commits with the same content as the commit you are cherry picking from. Cherry pick is very useful if you have e.g. accidentally commited a hotfix on main but want the fix on the release branch as well but you don't want to do a full merge from main into release, since it might contain other stuff that you don't want to release yet.
Upvotes: 2