How to get (only) author name or email in git given SHA1?

I would like to check for author‘s e-mail and name, surname to verify who’s pushing to my repo.

Is there any way that I can come up with a command in git to show commiter’s name/e-mail given only SHA1 of the commit?

  • tortoise svn shows useid, how can I change displayed name for author
  • GIT: filter log by group of authors
  • How to set git commit --author properly from rake running under LocalSystem account?
  • How to get authors of changes between 2 commits?
  • How do I change the default author for accessing a local SVN repository?
  • Extract authorship information from git repository
  • This is what I came up with but it’s far from ideal solution (the first solution is for git hook that’s why it’s using 2 SHA1s with rev-list. The second one simply uses git show):

    git rev-list -n 1 --pretty=short  ccd3970..6ddf170 | grep Author | cut -d ' ' -f2- | rev | cut -d ' ' -f2- | rev
    git show 6ddf170 | grep Author | cut -d ' ' -f2- | rev | cut -d ' ' -f2- | rev 

  • What is the point for git reset accepting paths as an argument when we have git checkout?
  • How to structure Git repo for multi-tier architecture
  • Git commits in emacs without changing window layout?
  • gitosis and git clone problem
  • unable to copy and paste in gitk - macosx
  • Making sense of git submodule status output
  • One Solution collect form web for “How to get (only) author name or email in git given SHA1?”

    You can use the following command:

     git log --format='%ae' HASH^!

    It is suppose to work with git show as well, but for some reason it doesn’t do anything for me when I tried it.

    git show --format='%ae' HASH
    Git Baby is a git and github fan, let's start git clone.