Why Git is not allowing me to commit even after configuration?
Solution 1
That’s a typo. You’ve accidently set user.mail
with no e in email. Fix it by setting user.email
in the global configuration with
git config --global user.email "[email protected]"
Solution 2
You're setting the global git options, but the local checkout possibly has overrides set. Try setting them again with git config --local <setting> <value>
. You can look at the .git/config
file in your local checkout to see what local settings the checkout has defined.
Solution 3
Do you have a local user.name
or user.email
that's overriding the global one?
git config --list --global | grep user
user.name=YOUR NAME
user.email=YOUR@EMAIL
git config --list --local | grep user
user.name=YOUR NAME
user.email=
If so, remove them
git config --unset --local user.name
git config --unset --local user.email
The local settings are per-clone, so you'll have to unset the local user.name
and user.email
for each of the repos on your machine.
Obby
Updated on July 08, 2022Comments
-
Obby almost 2 years
This question seems like a duplicate but it's really not. Just a slight difference that keeps on repeating. git keeps on telling me: "please tell me who you are", even after setting it up. when I run
git commit
, this is what I get....$ git commit *** Please tell me who you are. Run git config --global user.email "[email protected]" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got 'Obby@ObbyWorkstation.(none)')
But when I run
git config --global -l
, it gives me all my details...$ git config --global -l user.name=myname [email protected] http.proxy=proxy.XX.XX.XX:XXXX
I have changed my name, email and proxy but they are appearing fine when I run the command, even in the .gitconfig file I can see the values are set. what could be the missing thing, because I cannot commit at all. Every time it keeps asking me who I am ?
@sheu told me something that i changed, but still the same problem. when i set
--local
, stillgit commit
asks me the same question. this is the output$ git config --local -l core.repositoryformatversion=0 core.filemode=false core.bare=false core.logallrefupdates=true core.symlinks=false core.ignorecase=true core.hidedotfiles=dotGitOnly user.name=myname [email protected]
-
Obby over 11 yearsthanks...i couldn't even spot that. the problem of pressing the up arrow instead of writing afresh
-
sentientmachine about 7 yearsOh damn! Made the same mistake.
-
cSharma over 6 yearssorry but i couldn't understand where I need to set or else edit?
-
Jalal over 6 years5 years later and i made the same mistake!
-
Sophie Cooperman over 5 yearsYou can erase your git data in control panel: Control Panel → User Accounts → Credential Manager→ Windows Credential Manager. Then re-enter it with the correct username and password. This the only option that worked for me.
-
jaycee about 4 yearsIncredible how a typo can waste so much time! thanks mate!