Loading...
git stash
git switch hotfix
# fix, commit, switch back
git switch feature
git stash popgit worktree add ../app-hotfix hotfix
cd ../app-hotfix
# fix and commit
cd -
git worktree remove ../app-hotfixThe hotfix gets its own folder, so the feature branch keeps its uncommitted work untouched.
git worktree prune.git worktree add ../app-fix -b fix..env.git worktree remove, not just deleted from disk.Worktrees share one .git database, so commits and branches are visible in all of them at once. A second clone is fully separate.
Run git worktree list. It shows each worktree folder with its checked-out commit and branch.
Yes. Giving each agent its own worktree lets them edit files in parallel without overwriting each other.