刚开始使用SourceTree,提交代码时报错,如下:
git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\Users\AppData\Local\Temp\yo1s42oy.fz2
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
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:
unable to auto-detect email address (got ‘Colin@JustForMoney.(none)‘)
如图:
原因:没有设置用户名和邮箱
解决办法:运行git;敲如下命令
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
如果客户端没有装git, 可以在SourceTree中的菜单中点击“命令行模式”
设置完毕之后,就可以正常使用了