美文网首页
Git 切换分支:Please commit your chan

Git 切换分支:Please commit your chan

作者: littlefogcat | 来源:发表于2022-08-16 15:56 被阅读0次

Git 切换分支的时候遇到提示:Please commit your changes or stash them before you switch branches.

意思是切换分支之前需要先提交当前的更改;但是我又不想把修改提交到当前分支,应该怎么办?这时就可以用 Git 的贮藏(git stash)功能。

在 SourseTree 里面,点击最上方的按钮就能用贮藏功能保存代码了。


Stash

切换分支之后,在左侧的贮藏标签点击右键即可恢复更改。

相关文章

网友评论

      本文标题:Git 切换分支:Please commit your chan

      本文链接:https://www.haomeiwen.com/subject/jwtdgrtx.html