Why does 'git stash apply' stage my changes?

前端 未结 3 1849
臣服心动
臣服心动 2021-01-04 01:42

I make a change and then I git stash and then I git stash apply

My question is

  1. why after I git stash apply

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 02:45

    If you find that your changes are unexpectedly staged, do:

    git reset HEAD
    

    I usually only see this if there is a conflict when applying the stashed changes. You will want to check to see whether this is the case before doing the git reset.

    The git stash command is the most appropriate command for your use case. I use it all the time for exactly this purpose.

提交回复
热议问题