業務場景:使用git送出readme.txt檔案,結果出現如下提示:
- [[email protected] /home/pms/workspace/ouyangyewei/learngit]
- $git commit -m 'add readme.txt'
- *** Please tell me who you are.
- Run
- git config --global user.email "[email protected]"
- git config --global user.name "Your Name"
- to set your account's default identity.
- Omit --global to set the identity only in this repository.
- fatal: empty ident name (for <[email protected]>) not allowed
原因:如上述提示,git未設定使用者資訊
解決方法:設定user.email和user.name即可
- $git config --global user.name "ouyangyewei"
- $git config --global user.email "[email protected]"
- [[email protected] /home/pms/workspace/ouyangyewei/learngit]
- $git config --list
- user.name=ouyangyewei
- [email protected]
- core.repositoryformatversion=0
- core.filemode=true
- core.bare=false
- core.logallrefupdates=true
- [[email protected] /home/pms/workspace/ouyangyewei/learngit]
- $ls
- readme.txt
- [[email protected] /home/pms/workspace/ouyangyewei/learngit]
- $git commit -m 'add readme.txt'
- [master (root-commit) 3e48caa] add readme.txt
- 1 file changed, 2 insertions(