What is the intended use-case for git stash?

前端 未结 7 1612
野性不改
野性不改 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条回答
  • 2020-12-22 16:15

    The main idea is

    Stash the changes in a dirty working directory away

    So Basicallly Stash command keep your some changes that you don't need them or want them at the moment; but you may need them.

    Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.

    0 讨论(0)
提交回复
热议问题