Switch branches
One folder, one branch at a time. git switch needs a clean tree, so half-done work must be committed or stashed first.
Free developer tool
A git worktree is an extra working folder for the same repository, checked out on its own branch, so you can work on several branches at once without stashing or cloning. This builder writes the exact git worktree command for adding, listing, removing, pruning, moving, locking or repairing a worktree, explains what it does and lists the errors git may show. Parallel mode plans one worktree and branch per task for running AI coding agents side by side. Nothing runs on your machine until you paste it.
git worktree add -b feature/fix-login ../myapp-wt/fix-login mainCreates the folder, creates the new branch from the start point, and checks it out there. Your current checkout is not touched.
fatal: a branch named 'feature/x' already existsUse "Add worktree for an existing branch" instead. -B would reset the existing branch to the start point and can lose commits.fatal: '../myapp-wt/x' already existsPick a new folder, or delete the old folder first. If Git still lists it, run git worktree remove on it.fatal: '../myapp-wt/x' is a missing but already registered worktreeThe folder was deleted by hand but Git still tracks it. Run git worktree prune, then add it again.One folder, one branch at a time. git switch needs a clean tree, so half-done work must be committed or stashed first.
Parks changes so you can switch. Fine for a quick hop; easy to forget, and builds and dev servers restart every time.
One folder per branch, all sharing one .git history, so commits made in any worktree are visible in all. Each folder needs its own dependencies and .env.
Fully separate copy with its own history and remotes. Uses more disk, and you must push and fetch to move commits between clones.
Choose add, list, remove, prune, move, lock, unlock or repair, or switch to Parallel AI agents mode.
Enter the worktree folder, the branch name and the start point. The builder checks branch names against git naming rules and quotes paths with spaces.
Copy the command and run it from inside your repository. Read the common errors list if git refuses.
Remove each worktree, delete its merged branch and prune stale records so git worktree list stays accurate.
Two agents in one folder overwrite each other's files and confuse each other's test runs. Give each agent its own worktree and branch, start it inside that folder, and merge the branches one at a time after review. Keep the count small enough for your machine: each worktree runs its own install, build and dev server. Pick distinct dev server ports per worktree, and remove worktrees as soon as their branch is merged.
git worktree lets one repository have several working folders at once, each on its own branch. You can review a pull request, fix a bug or run a long test in one folder while your unfinished work stays untouched in another, without stashing or cloning again.
A branch is a line of commits. A worktree is a folder where a branch is checked out. Without worktrees you have one folder and switch branches in it; with worktrees each branch can have its own folder, and all of them share one .git history.
Run git worktree add -b <new-branch> <path> <start-point>, for example git worktree add -b feature/login ../myapp-wt/login main. Git creates the folder, creates the branch from main and checks it out there.
Run git worktree remove <path> from any checkout of the repository. It refuses if the worktree has uncommitted or untracked changes; commit them or add --force. Then delete the branch with git branch -d <branch>. If you already deleted the folder by hand, run git worktree prune.
Git lets a branch be checked out in only one worktree at a time. Work in the worktree that already has it, which git worktree list shows, or create a new branch for the new worktree with -b.
Give each agent its own worktree and branch so they never edit the same files on disk. Create one worktree per task, start the agent inside each folder, review and merge each branch, then remove the worktrees. The parallel mode above writes those scripts for you.
Running one agent per worktree by hand means many terminals and scripts. Tornic runs deterministic multi-step workflows on the Claude Code, Codex or Cursor CLI you already pay for.
Explore Tornic