Couldn't save uncommitted changes. Tried to save uncommitted changes in stash before Update

 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/

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章