简体   繁体   中英

Merging release to master after a patch release git

We recently migrated from svn to git. We currently have a release branch and a master branch. We merge release to master on the day of the release and tag it.

Now if we were to do a patch release. Which is create a branch off master as a hotfix branch and merge it to master, then create a new tag and release from there. Then we also merge that hotfix back into release so release has all of the changes in production while QA are testing it.

Then the issue comes in when we have to merge the release branch back into master.

1) We can't do a fast forward release as the master has diverged

2) If we do a normal merge even will it be safe (this will also add a merge commit) will that code be duplicated sometimes, what will happen we are not sure

3) We could rebase release from master, but this is a common public branch (would mess up developers local branch?) and rebasing release would be dangerous as well? If we don't rebase ideally we won't have a clean history on master branch with tag points in all releases either

How do you do a release and usually handle this

Then we also merge that hotfix back into release

We can't do a fast forward release as the master has diverged

One way to improve that workflow and avoid the diverge situation would be to add one more merge, just after the hotfix merge:

git checkout relase
git merge -s ours master

That way, you record that release and master are "merged".

That will allow you, later, to make a fast-forward merge from release to master .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM