My colleague accidentally merged a pull request into master that was not ready, then used the revert feature on bitbucket to undo the merge. The problem we have now is that the commits from the source branch are still present on the master branch (although they are ignored and don't effect the code), and it means that for any future pull requests or merges from that source the commits are effectively ignored. How do we get around this?
Hey @matgb ,
Just to help clarify, did this happen in Bitbucket Server or over in Bitbucket Cloud (bitbucket,org)?
It looks like this was submitted under Server, but the functionality of a pull request having a 'revert' button doesn't appear to be something that's been developed yet for Bitbucket Server.
With that said - my wheelhouse is in Bitbucket Server and how it ticks, but going off of the information on our Bitbucket Cloud PR merge page, it looks like the intent behind reverting isn't so much to remove commits (and thus git history) as much as it is to provide a convenient means of recovering the code itself to the state it was in before the PR was merged.
Having a revert outright remove the commits would involve rewriting git history, and could potentially be very destructive depending on the intent of the user attempting to revert the PR.
Hopefully this helps!
Thanks,
Evan Slaughter
Hey @Evan Slaughter thanks so much for the reply!
Apologies for the confusion regarding the cloud vs server - I definitely should have selected cloud.
Thank you for the clarification around the revert feature. I was interpreting it as more of an 'undo' but that really wouldn't make sense based on the effect it would have on git history. I found a work around by squashing commits on my branch then resubmitting a PR. Works for my use case.
Thanks again!
Mat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.