项目场景:
Idea正常切换Git分支没问题,但是修改文件后,再切换分支会弹出提示框
Your local changes to the following files would be overwritten by Checkout. Intelli IDEA can shelve the changes,Checkout and unshelve them after that.
大概意思就是:您对以下文件的本地更改将被“签出”覆盖。Intelli-IDEA可以搁置更改,然后签出并取消搁置。
解决方案:
我们可以看到给出了3个选项:
Force Checkout(强制签出,直接覆盖掉你修改的代码)
Smart Checkout(智能签出,会弹出框,让你合并代码)
Don't Checkout(不签出,取消的意思)
这里推荐先把修改的代码Commit,可以先commit,但是不push