Reputation: 2073
Here's our Scenario:
Developers fork off Master into a new Branch and develop some code. Master progresses. When it passes QA, and gets merged into Master, a complete regression test is run. Sometimes, one branch (of several being merged/tested that release) fails regression. So we want to revert that merge and continue release the rest of the code. Typically, just something needs to be tweaked in the original development branched, QA'd again, and then remerged into master, but because Master reverted the changes originally most of the branches changes are wiped out. How best to re-merge this dev branch into master after corrections are made without losing the changes due to the revert?
Upvotes: 0
Views: 234
Reputation: 23056
On the face of it this sounds like you are using revert incorrectly in your workflow.
To avoid this, if master has advanced beyond a branch you should merge master into the branch rather than the other way around.
So:
This workflow avoids any need to revert at any point as part of the promotion workflow (developers may still need to revert from time to time in their development branches).
You should never need to revert a merge from master to a branch since for the changes to have been accepted into master they must have passed testing before they reach the master in the first place. Therefore any failures arising from the merge into your branch are required to be resolved in that branch before they can be accepted back into master.
Upvotes: 1
Reputation: 32731
git won't merge any commits it already merged before. As the commits are still in the history of master (but were reverted by a later commit) git won't apply them again. The solution is either:
git revert
the commit that reverted the changes.or (better solution):
Upvotes: 0