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

后端 未结 2 1589
走了就别回头了
走了就别回头了 2020-12-09 15:01

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 c

相关标签:
2条回答
  • 2020-12-09 15:30
    git show <commit_id> | grep Author
    

    Using git show + pipe + grep works!

    0 讨论(0)
  • 2020-12-09 15:42

    You can use the following command:

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

    It works with git show as well. You need to include -s to suppress the diff.

    git show -s --format='%ae' HASH
    
    0 讨论(0)
提交回复
热议问题