How can I determine who deleted a branch in Stash, and restore it?

We've got a few repos now where users are accidentally deleting whole branches (long story) but we'd like to be able to determine who did it, and bring the branch back. Reflogs seems not to help. Thoughts?

2 answers

Determining who deleted the branch: there should be something about this in the logs. Maybe somebody from Atlassian knows what exactly and which file. Until then, if you search all the log files for the name of the branch, it will probably be relatively quick to locate.

Bringing the branch back: somebody who still has a local copy should push the branch again.

it's not the branch name which is of interest to you I believe, but rather to which commit it was pointing before it was deleted. so if someone with a local copy will push this branch again, you can't be sure it is pointing to the right commit.however, the reflog will tell you who/when it was done so you can get a clue. if you have an issue with it, you can also setup a hook which will prevent users from deleting important branches. 

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 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

29,163 views 26 12
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