What happens if you don't set the global configuration variables user.name and user.email for git before you start? Execute the following command to remove the settings for user.name and user.email in the git global configuration file :
$ git config--unset--global user.name$ git config--unset--global user.email
As a result, the settings for the user name and message are emptied , and the following command will not see the output:
$ git config user.name$ git config user.email
Try the commit again below to see what the situation is? Use the --allow-empty parameter in the following command, becausegit does not commit by default if no changes are made to the workspace file, allowing blank commits after using the--allow-empty parameter ( Note: After deleting the user.name,user.email, it seems to be unable to submit!!) ), operate as follows:
$ cd/path/to/my/workspace/demo$ git commit--allow-empty-m "who does commit?" Please tell me who is you. Run git config--global user.email "[email protected]" git config--global user.name "Your name" to set Your account ' s de Fault identity. Omit--global to set the identity of the repository.fatal:unable to Auto-detect email address (got ' [email protecte D] (none) ')
Take a closer look at the output after executing the git commit command, and Git provides detailed help to show us how to set the required configuration variables.
Let's look at the commit log for the repository :
$ git log--pretty=fullercommit 57CEAAD77F3D61CB330F99779B9DF52ADB835BE8AUTHOR:FUHD <[email Protected]>AuthorD Ate:thu Dec 19:30:23 +0800commit:fuhd <[email Protected]>commitdate:thu Dec 11 19:30:23 2014 +0800 Initlalized.
The submitter's information is given by the configuration variables User.Name and user.email that were previously set.
The thought of git initialization is who completes the commit