-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Low
-
Component/s: Pull Request - Revert
-
None
-
5
-
Severity 3 - Minor
-
220
Issue Summary
- As per the title, whenever a PR is merged using the fast-forward strategy, you get the following error message when trying to revert it:
Unable to revert pull request The resulting revert would cause conflicts on one or more files. You will need to resolve these conflicts manually or create a new pull request to revert these changes. - On the console log, we get a 400 with the following response:
{"type": "error", "error": {"message": "The merge commit doesn't have exactly two parent commits."}}
Steps to Reproduce
- Create a branchB from branchA;
- Commit your changes to branchB;
- Open a pull request from branchB to branchA;
- Merge it using the fast-forward merging strategy;
- Try to revert the PR;
Expected Results
- The PR should be reverted;
Actual Results
- An error occurs and it is not possible to revert the PR;
Workaround
Even though it is not possible to revert the Pull Request through the Bitbucket UI, it is still possible to do so from the command line:
- Identify the last commit before branchB was created with
$ git log
- Grab the commit SHA and run
$ git revert <SHA>
- This might generate a few conflicts that will need to be resolved locally;
- Commit the changes and push to the remote;