2.25. Stash Changes

TortoiseGit

2.25. Stash Changes

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, right click on a folder to pop up the context menu and then select the command TortoiseGitStash Save A dialog will pop up where you can optionally enter a message for this state:

Figure 2.48. Stash save dialog

Stash save dialog

You can also select include untracked, to stash untracked files away, too. To stash all files away, including ignored files in addition to the untracked files, select --all.

When TortoiseGit detects that a stashed changes exist, the context menu will be extended:

Figure 2.49. (un)stash options

(un)stash options


The stash is implemented as a stack. Stash Apply will apply the changes of the latest stash to your working tree. Stash Pop does the same, but will remove the latest stash from the stack after applying it. Stash Save is still possible and will stash the current changes of the working copy to the top of the stack. Stash List provides an overview of all the whole stash stack. You can also remove and view the stashed changes there (similarly to the Section 2.13, “Log Dialog” and Section 2.15, “Reference Log”).

[Important] Conflicts

Although major merge work is done by git automatically applying a stash, a conflict may happen during cherry-picking (i.e., a file was modified in your current branch and also in the stash), please see Section 2.31, “Resolving Conflicts” on how to resolve conflicts.

Please note, that "REMOTE"/"theirs" in the conflict editor refers to the to be merged stash and "LOCAL"/"mine" to your version in the working tree before you applied the stash.

You can find more information at Section G.3.128, “git-stash(1)”.