Git stash: “Cannot apply to a dirty working tree, please stage your changes”
问题 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 changes Any suggestion on how to deal with that? 回答1: When I have to apply stashed changes to a dirty working copy, e.g. pop more than one changeset from the stash, I use the following: $ git stash show -p | git apply -3 && git stash drop Basically it creates a patch pipes that to the apply command if there are any conflicts they will need to be