Discuss / Git / git stash 只能保存工作区的修改,暂存区的不会保存

git stash 只能保存工作区的修改,暂存区的不会保存

Topic source

入梦1203

#1 Created at ... [Delete] [Delete and Lock User]

比如初始内容为A,增加一个B后,执行 git add . 。

然后在增加一个C(此时工作区内容为ABC,暂存区为AB,当前分支版本库为A)。

现在使用 git stash,然后再用git stash apply 或者git stash pop 恢复,你会发现工作区内容恢复到了ABC,但是暂存区只剩下add之前的A了。


  • 1

Reply