This question already has an answer here:
I'm working on a server with several admin users. Each of them can use
sudo to make configuration changes. We're keepeing our
/etc directory version-controlled using etckeeper.
However, when I or another admin calls
sudo etckeeper commit COMMITMESSAGE, git uses the root user's name and e-mail for the commit message. Setting
git config user.name on the etc repository doesn't work in this case, because then each time
etckeeper commit is called, the same data will be used.
What I want is the actual user's name and email be present in the etckeeper git repository, so that from the commit log I can track down who did which change.
Any help is greatly appreciated!