I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in my pendrive, cloned from my computer at home). After several c
Note that git stores two different e-mail addresses, one for the committer (the person who committed the change) and another one for the author (the person who wrote the change).
The committer information isn't displayed in most places, but you can see it with git log -1 --format=%cn,%ce
(or use show
instead of log
to specify a particular commit).
While changing the author of your last commit is as simple as git commit --amend --author "Author Name
, there is no one-liner or argument to do the same to the committer information.
The solution is to (temporarily, or not) change your user information, then amend the commit, which will update the committer to your current information:
git config user.email my_other_email@example.com
git commit --amend