Jenseits von git stash pop
Stash kann mehr als das save/pop, das man normalerweise sieht. Gut verwendet ist es ein personlicher Notizblock fur Kontextwechsel, der das Committen von WIP in den Branch schlagt.
Mit Absicht speichern
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"
Auflisten und inspizieren
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}
Partielles Stashen
git stash push -p
Konfliktauflosung
git stash apply
git stash pop --index
Aufraumen
git stash drop stash@{4}
git stash clear
git reflog show stash
Anwendungsfall: vor Review neu bauen
git stash push -u -m "feature WIP"
git checkout main && git pull
git switch -c ci-fix
git checkout feature
git stash pop
Haufige Fehler
Mit nicht verfolgten Dateien stashen, aber ohne -u.