Getting 'fatal: empty ident name not allowed' when doing 'Git commit --amend'

Fixed it by deleting local config and using the global configuration

$ git config --local -e

now delete all local lines and save the empty file


Set global user.name and user.email first by order like below.

$ git config --global user.name "dzou"
$ git config --global user.email "[email protected]"

NB: careful, use double quote instead of single quotes


I had a similar problem because when I committed, the user.email was set correctly but user.name was empty. So even if I set the user name in the config, still I've got the same "empty ident" error.

I fixed it adding --reset-author to the amend command (after setting the correct user.name)

$ git commit --amend --reset-author

Tags:

Git