git报错:
2020-03-09
14:29 Couldn't save uncommitted changes.
Tried to save uncommitted changes in stash before Update, but failed with an error.
Couldn't stash file://C:/Users/sun/IdeaProjects/analysis: unable to auto-detect email address (got 'sun@DESKTOP-23CCM3M.(none)')
Cannot save the current index state
原因:
没有设置git邮箱
解决:
一、配置Git全局邮箱
1、打开Git 安装的目录,打开Git Bash。
2、双击打开Bash 输入命令,完成。
git config --global user.email 邮箱地址
邮箱设置好了 ,还是报错。
二、先提交一个文件
提交文件时,会提示设置邮箱,再次设置邮箱,然后提交即可。
参考:http://www.pianshen.com/article/9421666929/