IMHO, the proper way to resolve this error is to configure your global git config file.
To do that run the following command: git config --global -e
An editor will appear where you can insert your default git configurations.
Here're are a few:
[user]
name = your_username
email = [email protected]
[alias]
# BASIC
st = status
ci = commit
br = branch
co = checkout
df = diff
For more details, see Customizing Git - Git Configuration
When you see a command like, git config
...
$ git config --global core.whitespace \
trailing-space,space-before-tab,indent-with-non-tab
... you can put that into your global git config file as:
[core]
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
For one off configurations, you can use something like git config --global user.name 'your_username'
If you don't set your git configurations globally, you'll need to do so for each and every git repo you work with locally.
The user.name and user.email settings tell git who you are, so subsequent git commit
commands will not complain, *** Please tell me who you are.
Many times, the commands git suggests you run are not what you should run. This time, the suggested commands are not bad:
$ git commit -m 'first commit'
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
Tip: Until I got very familiar with git, making a backup of my project file--before running the suggested git commands and exploring things I thought would work--saved my bacon on more than a few occasions.
git pull
is going to create a commit, because it did a merge, for example.