create a new git project and only add README.txt when I commit, an error occurred.

The Problem here seems to be your username. Check it with git config --list.
You can change it with
$ git config --global user.name "validName"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With