What is the intended use-case for git stash?

前端 未结 7 1620
野性不改
野性不改 2020-12-22 15:39

If I work on branch A and suddenly need to work on branch B before being ready with a commit on branch A, I stash my changes on A, checkout B, do my work there, then checkou

7条回答
  •  梦毁少年i
    2020-12-22 16:05

    If you hit git stash when you have changes in the working copy (not in the staging area), git will create a stashed object and pushes onto the stack of stashes (just like you did git checkout -- . but you won't lose changes). Later, you can pop from the top of the stack.

提交回复
热议问题