>_ IzzyLab

Hands-on task

This task is step 7 of the course “Everyday Git”

Stash your changes

easy~2 min

In /root/project there are uncommitted changes in a tracked file. Stash them so the working tree becomes clean, but the changes are not lost (they can be brought back).

What you'll practise:
  • git stash
  • working tree
  • shelved changes
  • git status

Topic breakdown

git stash is a temporary stack where you can set aside uncommitted edits in tracked files and return the working tree to the state of the last commit. Nothing is lost in the process: the changes sit in a separate storage and can be retrieved (git stash pop/apply). This is handy when the edits are still too raw to commit but you need a clean tree quickly — for example, to switch branches.

What's checked

  1. working tree is clean
  2. changes are saved in the stash

What it looks like