0

The scenario is as below:

Assume that the state of master and develop branches are A, feature/issue-1 branch is B.
feature/issue-1 branch is created from master branch.

  1. Merge the code of branch feature/issue-1 into master branch.
    Now master branch has B code.

  2. Some errors found.
    Revert the merged commits at master branch, with git revert MERGE_COMMIT -m 1 command.
    Now master branch has A code.

  3. Merge the code of branch feature/issue-1 into develop branch.
    Now, develop branch has B code.

  4. Create feature/issue-2 branch from develop branch.
    Now feature/issue-2 branch has B code.

  5. Add some codes in feature/issue-2 branch.
    Now feature/issue-2 branch has B + C code.

  6. Merge the code of branch feature/issue-2 into develop branch.
    Now develop branch has B + C code.

  7. Trying to merge the code of branch develop into master branch.

I'm in the number 7 situation.

I opened a pull request to merge develop branch into master branch.

But when I check file changed in the opened pull requests, changes about B are not shown, and only C is shown.

Is this because I reverted B code before?

How can I resolve this?

yoon
  • 1,177
  • 2
  • 15
  • 28
  • 1
    Just a note : at step 2 you should have opted for either resetting to rewind master history back (if possible in your work context) or reverting actual commits (and optionnally squashing them all in one big revert) rather than the merge commit. If you had done the latter, now it would be simple : just revert the revert. – Romain Valeri Jul 22 '20 at 12:08
  • 1
    Yes, the reversal of `B` on the `master` branch is the reason for your state. In this case, I think the most reasonable way forward is to revert the revert. You could also think whether [this workaround](https://stackoverflow.com/questions/57904970/reverting-a-git-merge-while-allowing-for-the-same-merge-later/57905240#57905240) could work for you. – j6t Jul 22 '20 at 12:09

0 Answers0