Search code examples
gitgit-branchauthor

How to determine the author of a branch in git


There are multiple guys working on a git repository and all of them have write access to it. Someone by mistake has created random branches on the repo. How can we know who is the owner of these branches ?

Is there a way to identify the following things:

  1. Who created a particular branch ?
  2. When was the branch created ?

Solution

  • A 'branch' in git is only a label. All the info git knows is the name and a git hash.

    From that follows you can not ask git for that info. You might be able to figure it out form the content (author or committer of pathces), or a text file with description.

    In my repos there is a file repo_info.txt that describes the content, rules on commit, branching policy, etc.