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

后端 未结 11 1674
青春惊慌失措
青春惊慌失措 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:10

    Either clean your working directory with git reset, commit the changes, or, if you want to stash the current changes, try:

    $ git stash save "description of current changes"
    $ git stash pop stash@{1}
    

    This will stash the current changes, and then pop the second stash from the stash stack.

提交回复
热议问题