After Idea modifies the file, switch the Git branch and pop up a prompt box

Project scenario:

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.

 Roughly it means: your local changes to the following files will be overwritten by "checkout". Intelli-IDEA can shelve changes, then check them out and unshelve them.


 solution:

We can see that 3 options are given:

Force Checkout (mandatory checkout, directly overwrite your modified code)

Smart Checkout (smart checkout, a box will pop up to let you merge the code)

Don't Checkout (do not check out, cancel the meaning)

It is recommended to commit the modified code first, you can commit first, but not push

Guess you like

Origin blog.csdn.net/u011974797/article/details/130227719