The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why are commits from my source branch still found on destination branch after using "revert" button?

matgb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 29, 2020

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?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Evan Slaughter
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 5, 2020

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

matgb
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 7, 2020

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

TAGS
AUG Leaders

Atlassian Community Events