Is there a way to find who created a branch and when it was created without looking at commits?

Is there a way to find who created a branch and when it was created without looking at commits?

I have a need to know who created a branch and when it was created. A branch is a pointer to commits but these are two very different things. The author of a commit is not necessarily the creator of the branch. When cleaning up old branches, the creator of these branches should be contacted prior to deleting them in case they still want them.

I don’t see anywhere that GitLab has this information. Is it there but I don’t see it and just need directions to find it? Or, does GitLab need to be enhanced to capture that information?

Any help with this is greatly appreciated.

Hi,

Git itself does not allow you to track this, and a branch creation happens locally on the client. One way you could likely monitor this would be to look at push events and filter out the newly created remote branches.

If you want to prevent the creation of branches, you can also look into push rules.

Cheers,
Michael

1 Like

Thank you for your feedback.

I don’t understand. If I try to delete a branch that is not mine I get a Error encountered while deleting branch from the remote repository: PushCommand.ExecutePushComman. This information must be kept somewhere, right?

That is called permissions on the gitlab server. Since you are not the owner of the project most likely this is why you cannot delete the branch or it may even be protected.

1 Like