Git stash: “Cannot apply to a dirty working tree, please stage your changes”

后端 未结 11 1654
青春惊慌失措
青春惊慌失措 2020-12-12 09:04

I am trying to apply changes I stashed earlier with git stash pop and get the message:

Cannot apply to a dirty working tree, please stage your c         


        
11条回答
  •  攒了一身酷
    2020-12-12 09:19

    You can apply a stash to a "dirty" tree by doing a git add to stage any changes you've made, thus cleaning up the tree. Then you can git stash pop and apply the stashed changes, no problem.

提交回复
热议问题