Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name and email set in Git's per-user configuration file, however Git is still using the default generated name and email

Tags:

git

config

The title says it, but I will explain it more thoroughly:

I have configured my user's name and email as recommended using the commands:

git config --global user.name
git config --global user.email

I can verify that this is set by doing git config --global --list and I get the following output:

core.user=Joshua Guerra
[email protected]
core.editor=nano
push.default=simple

I can also verify it by doing cat ~/.gitconfig, where the output is:

# This is Git's per-user configuration file.
[core]
# Please adapt and uncomment the following lines:
user = Joshua Guerra
email = [email protected]
[core]
    editor = nano
[push]
    default = simple

So, I have verified that it is set properly. However I still get a message when I commit that says:

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]

And before you say, this only sets the values for future commits, understand that I understand that. Also, I have set this and repeatedly gotten the message that the values were NOT set even AFTER I set them and verified each time that they were set when I go to commit something.

I'm at a loss for why my system keeps giving me this message. If you need more info about what version and system I am on, I am happy to provide it upon request.

like image 837
Grissly Avatar asked May 01 '15 02:05

Grissly


1 Answers

The name and email settings should appear in the [user] section of ~/.gitconfig. They are not set correctly. Your ~/.gitconfig could have resulted from running the commands:

git config --global core.user "Joshua Guerra"
git config --global core.email [email protected]

The commands that should have been run are:

git config --global user.name "Joshua Guerra"
git config --global user.email [email protected]

To verify that the settings are correct, run git config --global --list and check the output for:

...
user.name=Joshua Guerra
[email protected]
...
like image 128
frasertweedale Avatar answered Nov 19 '22 01:11

frasertweedale