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

Alex Merenyi March 3, 2015

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

0 votes
Gabby Romano March 4, 2015

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.
https://marketplace.atlassian.com/plugins/com.sarav.stash.hooks.protectbranches.ProtectBranches/versions#b4 

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 3, 2015

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events