21

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?

sphere
  • 2,773
  • 4
  • 27
  • 53
  • 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
  • Yeah I guess that makes sense since most repos are public. I was imagining most projects would be a personal collaboration between friends or members of a company but obviously public is public. – sphere Mar 22 '17 at 16:41

3 Answers3

18

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,050
  • 10
  • 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,220
  • 1
  • 25
  • 42