Stash: Automatic Merge overwrites more recent commit/merge with tons of legacy garbage files

When my colleague recently did a npull request and merge via stash, although he did only commit 1 file, Stash overwrote my more recent merges with his legacy files and even went to delete tons of my more recently commited and merged files (master is locked).

How can this happen and how would you prevent this from happening in the future?

2 answers

Stephan,

I would recommend introducing at least one mandatory reviewer on all PRs especially those that will result in a merge to master.

Adaptavist recently released a new Add-on to the marketplace called ScriptRunner for Stash which would allow you to set a condition together with a single user or group of users automatically as mandatory reviewers.

You could set this to ensure a simple review of PRs are taking place before being merged and you could also use it to conditionally automatically merge too.

Feel free to take a look and send us any feedback as to its suitability.

I hope it helps.

First you need to understand that you don't commit files.  You commit on the repository - every commit contains every file.

The merge should have merged changes you had each made to the project and should have failed if any of those changes conflicted.  It shouldn't have simply overwritten your changes with his.

You can minimize the pain of merging by doing it early and often.  If a feature branch is taking a long time to work on, it should be periodically updated (using a merge or rebase) with new content from the master branch.

 

 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

143 views 6 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you