git错误解决-Your local changes to the following files would be overwritten by checkout

    技术2022-07-11  110

    问题

    使用idea开发时候,git切换分支会抛出异常如下:

    error: Your local changes to the following files would be overwritten by merge: Please commit your changes or stash them before you merge.

    解决方法

    方法一(提交修改)

    提交修改后再切换分支。

    方法二(贮藏stash )

    对未提交的修改进行贮藏,然后再次切换分支。

    等到切换回来这个分支,再进行恢复

    stash 使用详解

    https://blog.csdn.net/fly910905/article/details/88711075

    https://www.cnblogs.com/zndxall/archive/2018/09/04/9586088.html

    参考:

    https://blog.csdn.net/a303549861/article/details/82467400

    Processed: 0.010, SQL: 9