admin 管理员组文章数量: 888398
Git 切换分支报错error: Your local changes to the following files would be overwritten by checkout:
当前分支代码还未提交,就切换分支报如下错
error: Your local changes to the following files would be overwritten by checkout:
Please commit your changes or stash them before you switch branches.
Aborting(请在切换分支之前提交您的更改或隐藏它们)
执行命令git status查看当前工作区的文件状态
Changes to be committed:表示已经从工作区add到暂存区的文件,下一步可以进行push
在当前分支上执行 git stash 命令,将当前分支存起来,id为 efa05be
这时候再执行 git status 命令,显示没有东西需要提交,接着就可以在主分支master上创建并切换到新的分支
本文标签: Git 切换分支报错error Your local changes to the following files would be overwritten by checkout
版权声明:本文标题:Git 切换分支报错error: Your local changes to the following files would be overwritten by checkout: 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1699079509h326872.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论