Stash & Worktrees
You're mid-edit in app.py when a teammate pings: their fix needs the working tree clean right now. You don't want a half-baked commit, and you don't want to lose the last hour of work.
- ▸
cat .git/refs/stashprints one hash: the work you set aside is a commit with two parents. - ▸A
git stash popthat succeeds drops the entry from the stash list;git stash applykeeps it there. - ▸A second working tree copies zero objects: the store is shared, only
HEADandindexare private.
The edits to app.py and config.json are half-finished, and the teammate's fix cannot wait. Committing now would stamp a broken snapshot onto your history. Throwing the edits away is unthinkable. You need to put this work down somewhere safe and come back to a clean folder.
Git gives you two shapes for "put it down." One parks your tracked edits off to the side, so those files return to exactly what your last commit held. The other leaves your folder untouched and hands you a *second* folder next door, checked out from your last commit on its own branch, two live copies of the project at once. They cost different things and they feel different. Run each one on the same half-finished folder and watch which one keeps your edits on screen while the fix happens.