Stashes
You can use Stashes to view all stashed changes in your repository.
Navigate Stashes
In the activity panel, Push Stash sits on the title row beside More actions.
To open Stashes, click Git > Stashes.
Stashes are listed chronologically and display the following information.
- Stash ID: The most recent stash is assigned the
stash@{0}ID. - Stash name: The name of a stash is
WIPby default. - Timestamp: The amount of time since the stash was created.
- Files: The number of files in the stash.
- Branch name: The branch where the stash was created.
Stashes also shows whether a stash includes untracked files.
In the activity panel, open More actions and select Compact Mode under View to show each stash on one line. A check mark shows when it is on. In a separate tab, use the Toggle compact mode icon.
To open a stash in a separate tab, right-click the stash and click Open in New Tab.
Create a stash
To create a stash, complete the following steps.
- In Stashes, click Push Stash.
- In the Push Stash dialog, enter a stash message in the Message field.
- Click Stash to create a stash with your current changes.
You can change the scope of the stash in Advanced options.
Stash selected files
When you open Push Stash from Stashes, all selectable files in the current scope are selected. To select fewer files:
- Click View files.
- Clear the checkboxes for files you do not want to stash. Keep at least one file selected.
- Click Stash Selected Files.
Changes in unselected files stay in your working tree and index. A staged rename and a file with both staged and unstaged changes each count as one file. Submodules cannot be selected. Open a submodule to stash changes inside it.
To stash one file, open Staging. Right-click the file. Click Stash This File….
Scope options
- Staged Files Only stashes only staged changes. Unstaged changes, untracked files, and ignored files stay unchanged. If staged and unstaged changes overlap in a selected file, Zide does not create the stash.
- Keep staged changes in place keeps the selected files’ staged changes in the index and working tree after the stash is created. This option is unavailable with Staged Files Only.
Zide needs the Git command-line tool for Staged Files Only and for stashes limited to specific files.
Stash view
Click a stash row to open the stash in Stash view. The Stash view displays the following information.
- Stash ID: The most recent stash is assigned the
stash@{0}ID. - Timestamp: When the stash was created.
- Branch: The branch where the stash was created.
- Changed Files: Which files were changed in the stash.
The Changed Files section works as in the Commit view: click View Diffs to open the stash in the Diffs view, or click a file to open the Diffs view at that file. Right-click a file for more commands; for example, Open File opens the file as it is in your working tree now, not the stashed version. See Changed files.
Stash actions
In the Stash view, click Pop or Apply in the header. Pop (Restore Staging), Apply (Restore Staging), Create Branch…, and Drop are in the More actions menu. In Stashes, right-click a stash to use the same actions.
| Action | Result |
|---|---|
| Pop | Applies the changes in the stash, then deletes the stash. The stash is deleted only after the changes apply cleanly. |
| Apply | Applies the changes in the stash and keeps the stash. |
| Pop (Restore Staging) | Like Pop, and also restores which changes were staged when you created the stash. |
| Apply (Restore Staging) | Like Apply, and also restores which changes were staged when you created the stash. |
| Create Branch… | Creates a new branch and applies the stashed changes. |
| Drop | Deletes the stash. |
During a merge, rebase, cherry-pick, revert, or patch series, all Pop and Apply actions and Create Branch… are disabled. Their tooltips explain why. Drop stays available.
Restore staging
Pop and Apply restore your file contents but not the staging saved in the stash. This matches git stash pop and git stash apply. Git can still stage some files, for example new files in the stash. Review Staging before you commit.
To also restore which changes were staged, use Pop (Restore Staging) or Apply (Restore Staging). For example, if you staged the first line of a file but not the last line, the first line is staged again and the last line stays unstaged. These actions run git stash pop --index and git stash apply --index.
Zide does not restore staging in these cases:
- Other changes are already staged. If the stash has staged changes, Zide stops before it changes anything. Commit or unstage your changes, and then try again.
- The staged changes no longer apply. For example, a later commit changed the same lines. Zide shows an error and does not apply the stash. To apply only the file contents, use Pop or Apply.
- The stash conflicts. Git does not restore staging when the changes conflict. The conflict banner shows Staged changes were not restored.
Each action applies to the stash you opened. If that stash is removed or its position in the list changes before the action starts, Zide stops the action. See The repository changed before an action could start.
Resolve stash conflicts
Applying a stash can conflict when the files it touches have changed since you created it. For example, you stash your work, pull new commits, and then pop the stash.
When this happens, Zide displays a Conflicts detected banner listing how many files need resolving. Click Open Staging to open Staging for that repository, where the unresolved files appear.
A conflicting Pop keeps the stash. Your stashed work remains recoverable until the changes apply cleanly.
Assist with This
Right-click a stash and point to Assist with This. In the Stash view, you can also right-click the content header or an ordinary background area, or click More actions.
Under Zide Assist, click Add to Conversation to attach the stash to a Zide Assist tab. You can also drag the stash into a Zide Assist tab. For more information, see Attach items to a message.
Under Ask Zide, click Open Ask Zide. Zide opens the stash in the Stash view with an Ask Zide panel beside it. In the panel, click Summarize Stash or Review Stash. See Ask Zide beside a tab.