git pull問題:Please, commit your changes or stash them before you can merge.

使用 git pull 更新代碼時遇到如下問題:

error: Your local changes to the following files would be overwritten by merge:
	xxx/xxx/xxx.java
Please, commit your changes or stash them before you can merge.
Aborting
解決方法:git stash
含義:備份當前的工作區的內容,從最近的一次提交中讀取相關內容,讓工作區保證和上次提交的內容一致。同時,將當前的工作區內容保存到Git棧中。

然後再次git pull

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