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.
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".
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.
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.
To show description of a branch, use command git config branch. <branch name>. description .
List remote Git branches by author sorted by committer date:
git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)' --sort=committerdate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With