The thought of git initialization is who completes the commit

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.