Video: Stash work and resume it safely
The video plays in YouTube’s player, in privacy-enhanced mode.
- 5 min video
- English narration · English and Arabic captions
- Watch on YouTube
Set an unfinished edit and a new note aside with stash, bring them back with Apply, and see what Pop does when it conflicts: the stash stays until you decide.
Read the full lesson
The article has every step and command from the video, the practice exercise and the questions.
Video transcript
The narration of the video, cue by cue.
- Set unfinished work aside, and bring it back safely.
- A stash holds your edits on a shelf, and cleans the work tree.
- Apply brings the changes back and keeps the entry. Pop removes it, if clean.
- Make a branch with one commit, then edit the file and add a new note.
- In the changes list: one modified file, and one new file.
- Write down the current commit. It must not move.
- Open the palette and run Stash Changes.
- Give it a message you will recognize.
- Only staged is off. Include untracked is on. Keep staged is off.
- Ignored files are a different category, and do not go in.
- Choose Stash, and wait for the notice.
- The changes list is empty, and the stash is listed.
- The tooltip says untracked files are included. Show Stash lists its files.
- Right-click the stash, and choose Apply Stash.
- The notice says the stash is still in the list.
- Both are back: the edit, and the note.
- The branch tip is the same commit. No stash command made one.
- And the stash is still on the shelf.
- In the terminal, git stash push with include untracked, then the status.
- The list shows the message, with the branch name first.
- git stash apply brings both back.
- The stash is still listed, and HEAD is the same.
- Without that option, the note stays on disk.
- In the conflict copy, we commit another change first, and then pop.
- The warning says the stash is kept. The file is conflicted.
- Resolve the file, and mark it resolved. The stash is still there.
- Delete the stash only when you are sure. Or give it its own branch.
- Practice: prove clean, restored, and kept. Then predict without include untracked.
- Next, learn what reset soft, mixed and hard each change.