Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out a Git branch creator

Tags:

git

git-branch

I want to find out who created a branch.

I am sort of able to do so with:

git branch -a | xargs -L 1 bash -c 'echo "$1 `git log --pretty=format:"%H %an" $1^..$1`"' _

However, this returns the last committer per branch, not necessarily the person who created the branch.

like image 971
Ofir Farchy Avatar asked Aug 21 '12 12:08

Ofir Farchy


People also ask

How do you find out who created a git branch?

You can't get a branch author / creator in git. What you are doing here is get the author of the branch's tip. It will change as soon as someone pushes a new commit there. Disclaimer : The implicit assumption in this question/answer is "in a workflow with only one person per branch".

How do I find out when a branch was created?

reflogexpire and you have run git gc (or it was run automatically), you would have to find common ancestor with the branch it was created from. Take a look at config file, perhaps there is branch. <branchname>. merge entry, which would tell you what branch this one is based on.

How can I tell when a branch was created in github?

you can try with git reflog or git show --summary command to check this. I used this below API to get the branch created date But it shows only commit date.

How do I find my branch description?

To show description of a branch, use command git config branch. <branch name>. description .


1 Answers

List remote Git branches by author sorted by committer date:

git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' --sort=committerdate
like image 140
DarVar Avatar answered Oct 01 '22 21:10

DarVar