刚开始使用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中的菜单中点击“命令行模式”
设置完毕之后,就可以正常使用了
文章详细介绍了在使用SourceTree提交代码时遇到无法自动检测到邮箱地址的问题,通过运行git配置命令解决该问题。包括在客户端未安装git的情况下,如何在SourceTree中启用命令行模式来解决此问题。
1899

被折叠的 条评论
为什么被折叠?



