AS上git的使用与遇到的问题

1.使用git update后当前未提交代码被覆盖

Local changes were not restored
Before update your uncommitted changes were saved to stash.
Update is not complete, you have unresolved merges in your working tree
Resolve conflicts, complete update and restore changes manually.

由于项目里的小伙伴把结构目录改了,然后我在update之前没有把本地代码上传到本地git仓库内,导致出现了如下警告

  

大意就是说,merge失败了有冲突,你要自己手动先把他们解决了,你之前做的修改我帮你保存到一个地方stash仓库里面了

解决方法:

  1).使用stash插件:直接点击上图中的stash,选择要恢复的版本以后点击apply stash就行了,然后就会让你merge冲突

  

  2).使用git命令的方法

存档:$ git stash

读最新存档:$ git stash pop

查看存档列表:$ git stash list
(让我想起了minecraft里的指令,很像有木有乛◡乛 )

读指定的某个存档:$ git stash apply stash@{存档编号}
如:$ git stash apply stash@{1}
原文地址:https://www.cnblogs.com/slothccc/p/6702426.html