git stash使用一则

当在新的分支工作,修改的文件提交到暂存区,这时,切换到其他分之,可能报错,因为米有commit,如果切换到其他分支,暂存区的修改可能丢失,我们可以使用
git stash save -a(暂存区) "自定义名字"
执行后。我们还是在新分之,但是之前修改不见了。工作区干净

我们这时可以切换到其他分支,例如master

我们在master工作完成后 切换到原来的分之。查看stash

git stash list

希望还原暂存区 git stash pop --index stash@{0}

猜你喜欢

转载自www.cnblogs.com/or2-/p/9249341.html