I'm using git to track changes to a series of system configuration file on a server. These files are owned by the root account (and for various internal enterprise-y reasons, root is the only account on this box).
There is a central git server, which all changes made on this system are being pushed to.
What I'm trying to do is suppress the warning that git throws because there isn't a user account set. What we do is, anyone changing a file under git control simply sets the --author option when they do the commit - however, git still complains that the user information isn't set.
For detail, the exact message is:
[root@server ~]# git commit --author "Karunamon <[email protected]>"
[master 491d9f8] File updated
Author: Karunamon <[email protected]>
Committer: root <root@server>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 1 insertion(+), 1 deletion(-)
So basically, this is a twofold question:
First, Is there a way to squelch this warning message? Setting the config variable is going to end in confusion since there will be a number of people accessing this same repository on this server under the root account.
I did try using the environment variables (GIT_AUTHOR_EMAIL, GIT_AUTHOR_NAME, etc), but the same message comes up.
Second, Is there a better way (short of some horrid hack involving an .rc file and asking on login) to set the user name and email so that my users don't have to add an --author flag to every commit?
The environment variable option would have been perfect - I could just have my users export the variables on login and then they're good until next connect.. but git still whines.