50

I can't see how to email a contributor on github after lengthy attempts, and google searches. Why does every beginners guide encourage us to immediately configure our user.email such that it is sent with every commit if its so difficult to view the contributors' email addresses on the commit chain in GitHub?

jsstuball
  • 4,104
  • 7
  • 33
  • 63
  • 1
    Being able to easily get people's mail addresses from a web site doesn't sound like the best anti-spam technique out there, I'd guess. You can get them through a lot of git commands, though: blame, log, for example. – eftshift0 Mar 22 '17 at 16:38

4 Answers4

26

You can use

git log

or

git show [commit number]

Output:

commit 5f3be67saki52cv80l0e4f55c05ec897de3sdgt67
Author: someone <someone@mail.com>
Date:   Wed Mar 23 17:10:48 2017 +0100

    Commit message
Lahiru
  • 1,428
  • 13
  • 17
4

Here is some command to get author and email of the last commit:

git show --format="%aN <%aE>" COMMIT_ID

Here the version for older git versions (<= 1.6)

git log -1 --pretty=format:"%an <%ae>"
rakwaht
  • 3,666
  • 3
  • 28
  • 45
0

To obtain a sorted list of all contributors' email addresses, you can do this:

>>> some_repo % git log --pretty=format:%ae | sort -u% 

120996278+gourcetools@users.noreply.github.com
127570430+HiraduNakamura@users.noreply.github.com
130280013+eachadea@users.noreply.github.com
22169537+kuvaus@users.noreply.github.com
2680461921@qq.com
50458173+adtreat@users.noreply.github.com
585865+dte@users.noreply.github.com
68208096+Yuvanesh-ux@users.noreply.github.com
76754747+jacoobes@users.noreply.github.com
784313+TheBloke@users.noreply.github.com
BoQsc@users.noreply.github.com
adam.treat@qt.io
aloui.seifeddine@gmail.com
andriy.mulyar@gmail.com
anton-sa@web.de
...
AlanSTACK
  • 5,525
  • 3
  • 40
  • 99