Skip to content

Git — stash ​

Everyday Park work without committing.

Basic ​

bash
git stash                 # tracked changes
git stash -u              # include untracked
git stash -a              # include ignored too (rare)

git stash list
git stash show -p
git stash pop             # apply + drop
git stash apply           # apply, keep stash
git stash drop stash@{0}

Named stash ​

bash
git stash push -m "wip: login validation"
git stash list
git stash apply stash^{/login}

Stash one path ​

bash
git stash push -m "only css" -- src/styles/

Move changes to a branch ​

bash
git stash
git switch -c feature/from-stash
git stash pop

Conflicts on pop ​

bash
git stash pop
# fix conflicts, then:
git add .
# stash entry may still exist if pop failed — drop when done:
git stash drop

Clear all stashes ​

bash
git stash clear    # destructive