Reputation: 87
Is possible to find creator name in some variable from .git or another place? I would like to find this info from remote side of server. I used Repos GitHub Api https://api.github.com/repos/{:owner}/{:repository} and it works fine, but I am affraid if repository would not on GitHub.
Is something simmilar not addicted to GitHub Api and usable for GitHub alternatives?
I would like to find someting built in git but can not find anything. Not all repos have about the same of creating time or author name as first commit and that's the problem for making statistic from repo
Upvotes: 3
Views: 2515
Reputation: 9258
For git, the creator is not an officially stored information, but you can get author of the first commit:
git log --all --max-parents=0 --pretty=format:%an
It will print author's name, or you can use "%ae" for email.
Note that there can be several first commits, it would print them all then. You could limit it to one by option "-1", but it's hard to make any promises on which one it would pick
Upvotes: 3