转:https://blog.csdn.net/wgy1160754366/article/details/69547491

https://www.oschina.net/question/948439_2231748

https://www.jianshu.com/p/dbcf28202d15?from=timeline

https://www.jetbrains.com/help/idea/2016.2/shelving-changes.html

要提交代码,先更新代码(Update project),然后再提交,这是平常一直使用的步骤。结果执行更新后,没有提示合并,把代码给我回退了到以前的版本了,在intellij 右下角提示了 Local changes were not restored

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

意思是:代码和服务器上的有冲突,合并失败了。未提交的更改被暂时保存到了stash (git的暂存区),要手动处理合并。

提交代码步骤:先commit到本地,再去pull代码,再push代码

 

stash 与 shelve区别:两个都是把代码搁置,只是 stash是git原生的。shelve是idea独有的。

 

  1. shelve存在当前项目下.idea/shelve里
  2. 查看shelve,打开version control面板,点开shelf
  3. unshelve,在面板里选择你需要unshelve的条目即可
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐