How to correct email id in git review header?

Viewed 72

When i raised a PR(pull request) in GitHub , i had wrong email-id i.e abc@xyz.com.

$ git log
commit 4f65741b4b414bdf7e287c7bbd28d5e727ff62b9 (HEAD -> perf-enh-tcs)
Author: abc<abc@xyz.com>
Date:   Mon Aug 24 15:53:43 2020 +0530

The email-id in GitHub is abc@xyz.tech. So due to mismatch, there is error in PR.

I tried fixing the email-id on my laptop git account to abc@xyz.tech using below command git config --global user.email "abc@xyz.tech"

When i pushed the new patch set , i still see old email taken and PR failing.

1 Answers

Run the following command to amend (change) the author of the latest commit:

git commit --amend --author="Full Name <email@xxx.y>" --no-edit
  • What the command does is overwriting the most recent commit with the new one.
  • The --no-edit flag allows you to modify your commit without changing its message.
Related