Oltre git stash pop
Lo stash e piu capace del semplice save/pop che si vede di solito. Usato bene, e un blocco appunti personale per cambi di contesto che batte il committare WIP nel branch.
Salvare con intento
git stash push -m "WIP: parser refactor"
git stash push -m "config tweaks" -- src/config/
git stash push -k -m "without staged"
git stash push -u -m "include untracked"
git stash push -a -m "include ignored"
Elencare e ispezionare
git stash list
git stash show stash@{2}
git stash show -p stash@{2}
git diff stash@{0}^1 stash@{0}
Apply, pop, branch
git stash apply
git stash pop
git stash apply stash@{3}
git stash branch fix-bug stash@{1}
Stash parziale
git stash push -p
Risoluzione conflitti
git stash apply
git stash pop --index
Pulizia
git stash drop stash@{4}
git stash clear
git reflog show stash
Caso d'uso: ricostruire prima della review
git stash push -u -m "feature WIP"
git checkout main && git pull
git switch -c ci-fix
git checkout feature
git stash pop
Errori comuni
Fare stash con file untracked ma senza -u. Trattare lo stash come archiviazione a lungo termine.