GitWorktree.org logoGitWorktree.org

Git Worktree vs Stash

Both git worktree and git stash help you deal with in-progress work, but they solve different problems. Stash temporarily shelves changes so you can switch branches. Worktree gives you a second working directory so you never need to switch at all.

Comparison at a Glance

AspectGit StashGit Worktree
What it doesSaves uncommitted changes to a stack and reverts the working tree to a clean stateCreates a separate directory with its own checked-out branch
Context switchingSequential — stash, switch, work, switch back, popParallel — both branches are available at the same time
Risk of conflictsgit stash pop can produce merge conflictsNo conflict risk — each worktree is independent
Build stateDestroyed on every switch — node_modules, build caches, etc. are sharedPreserved — each worktree has its own files on disk
Disk costNone (stash entries are stored as commits in the object store)Size of the checked-out files
Forgetting about itEasy to forget stashed work; stash list grows silentlyThe directory is visible on disk; git worktree list shows all worktrees

When to Use Git Stash

When to Use Git Worktree

How to Move Stashed Changes to a Worktree

If you have already stashed changes and now want to apply them in a separate worktree, here is how:

Step 1: Create a new worktree
# Create a worktree with a new branch based on where you stashed
git worktree add -b feature/resume-work ../resume-work
Step 2: Apply the stash in the new worktree
cd ../resume-work

# List stashes to find the right one
git stash list
# stash@{0}: WIP on main: abc1234 Add header component
# stash@{1}: WIP on main: def5678 Update API client

# Apply the stash (keeps it in the stash list)
git stash apply stash@{0}

# Or pop it (removes it from the stash list)
git stash pop stash@{0}

Because stashes are stored in the shared object store, they are accessible from any worktree. You do not need to do anything special to transfer them.

Alternative: Create a Branch Directly from a Stash

Git has a built-in command that creates a branch from a stash and applies the changes in one step. You can combine this with worktrees:

# Create branch from stash (in current directory)
git stash branch feature/from-stash stash@{0}

# Or create a worktree first, then apply:
git worktree add -b feature/from-stash ../from-stash
cd ../from-stash
git stash pop

Related Pages