Skip to content

Free, open-source desktop app

A Git worktree alternative that copies your whole project.

lpm Duplicate copies the project you're actually working in, not just its committed files: uncommitted edits, .env files and node_modules come along into a standalone repository. Then it can start Claude Code, Codex or any command in each copy.

3,700+ downloads148 GitHub starsMIT-licensed source on GitHub

Git worktree limitations

Why not just use git worktree?

The main limitation of a Git worktree: it checks out committed files on a new branch. Your .env files, node_modules and uncommitted edits stay behind, and by default Git refuses a branch that's already checked out elsewhere. A copy of the project folder brings all three, on the same branch. lpm makes that copy with Duplicate, and real worktrees with New worktree.

Say you're mid-change in shop, a Next.js app on branch main: src/billing/trial.ts has an uncommitted edit, notes/todo.md is untracked, and .env, node_modules and .next are ignored by Git. Each panel shows the new folder that lands next to shop.Comes alongDifferent from shopMissingRebuilt on the next run

Built into Git

git worktree add

$ git worktree add -b try-2 ../shop-2
shop-2/linked worktree
  • Different from shop:
    .git

    a file pointing back at shop's repository

  • Different from shop:
    try-2

    a new branch, because main is already checked out in shop

  • Different from shop:
    src/billing/trial.tsmodified

    the committed version; your edit isn't there

  • Missing:
    notes/todo.mduntracked

    not in Git, so never checked out

  • Missing:
    .envignored

    ignored by Git, so never checked out

  • Missing:
    node_modules/ignored

    not there; run npm install

  • Rebuilt on the next run:
    .next/build cache

    not checked out; rebuilt on the next run

2 things to set up by hand, once per worktree

Copy .env, run npm install. Your uncommitted edit and notes/todo.md stay in shop.

Duplicate optionsThe same switches as the Duplicate dialog

In lpm

lpm Duplicate

Right-click shop, choose Duplicate, then Create 1 copy

shop-k3Fq9Z/standalone copy
  • Comes along:
    .git/

    its own repository; stale worktree entries removed

  • Comes along:
    main

    same branch as shop; tries to fast-forward to the newest commits

  • Comes along:
    src/billing/trial.tsmodified

    your uncommitted edit

  • Comes along:
    notes/todo.mduntracked

    copied

  • Comes along:
    .envignored

    copied

  • Comes along:
    node_modules/ignored

    copied along, as a copy-on-write clone on APFS

  • Rebuilt on the next run:
    .next/build cache

    left behind; rebuilt on the next run

Nothing to copy or install by hand

Starts where you left off, uncommitted edit included. Dependencies are already installed.

Each of these gaps is fixable by hand or with a setup script. lpm makes real worktrees too

One project, several copies, an agent in each

A short video: duplicate a project so each agent has its own copy.

lpm is a desktop app with a multi-pane terminal workspace. Open this page on your computer to try the interactive demo.

Get lpmOr check your computers from your iPhone
Other ways to switch tasks

Git worktree alternatives compared

The alternatives to git worktree, from git stash to a full project copy, and what each one brings with it.

  • Yes
  • Partly, or depends on setup
  • No

Built into GitNothing to install.

  • git stash + git switch

    git stash && git switch -c try-2

    The same folder, switched to another branch.

    • Own repository: no
    • Same branch twice: no
    • .env & node_modules: yessame folder
    • Uncommitted edits: nostashed

    Trade-off: Nothing runs side by side: every switch rewrites the files your editor, dev server and agent are working on.

  • Another git clone

    git clone . ../shop-2

    A separate repository, checked out fresh from your last commit.

    • Own repository: yes
    • Same branch twice: yes
    • .env & node_modules: no
    • Uncommitted edits: no

    Trade-off: Copy .env and install dependencies again by hand, and origin points at your local folder, not your Git host.

  • git worktree add

    Baseline

    git worktree add -b try-2 ../shop-2

    A second checkout linked to the same repository, on a new branch.

    • Own repository: no
    • Same branch twice: norefused by default
    • .env & node_modules: no
    • Uncommitted edits: no

    Trade-off: Light on disk, since history is shared. Worktree managers and setup scripts can copy .env and install dependencies, once for every worktree.

Other tools and recipesMore control, more to maintain.

  • Copy-on-write folder copy

    cp -c -R ../shop ../shop-2macOS, APFS

    cp -R --reflink=auto ../shop ../shop-2Linux, btrfs or XFS

    The whole folder, with .git, your edits, .env and node_modules, sharing unchanged blocks with the original.

    • Own repository: yes
    • Same branch twice: yes
    • .env & node_modules: yes
    • Uncommitted edits: yes

    Trade-off: By hand every time. The copy inherits any worktree entries of the original, so Git refuses those branches in it, and build caches come along too.

  • Jujutsu workspaces

    jj workspace add ../shop-2

    A second working copy of the same repository, started from your current change's parent.

    • Own repository: no
    • Same branch twice: yes
    • .env & node_modules: no
    • Uncommitted edits: partlywith -r @

    Trade-off: Means moving your workflow to jj, and, like a worktree, each new workspace needs its setup again.

  • Dev containers

    .devcontainer/devcontainer.json

    Its own runtime (processes, ports, services) around files you clone, copy or mount in.

    • Own repository: partlydepends
    • Same branch twice: partlydepends
    • .env & node_modules: partlydepends
    • Uncommitted edits: partlydepends

    Trade-off: The heaviest setup: Docker, an image and a config to maintain. The only option here that can isolate ports and databases.

In lpmBoth open the same dialog.

  • lpm Duplicate

    Right-click a projectDuplicate

    Up to 50 standalone copies of the folder you're working in, each a fast copy-on-write clone on APFS and a full copy where the disk can't clone. Build caches like .next stay behind.

    • Own repository: yes
    • Same branch twice: yes
    • .env & node_modules: yes
    • Uncommitted edits: yes

    Trade-off: Disk use grows as copies change, and ports and databases stay shared with the original.

    See the Duplicate dialog
  • lpm New worktree

    Right-click a projectNew worktree

    Real Git worktrees on new lpm/<name> branches from the commit you're on, up to 50 at a time.

    • Own repository: no
    • Same branch twice: no
    • .env & node_modules: partlyinstall option
    • Uncommitted edits: no

    Trade-off: Removing one also deletes its lpm/<name> branch, even unmerged, so push or merge first.

    When a worktree is the better choice
Side by side

Git worktree vs git clone vs lpm Duplicate

What gets copied, and what stays shared, row by row.

Git worktree, git clone and lpm Duplicate compared on ten properties
PropertyGit worktreegit clonelpm Duplicate
Git relationship

Linked to the original repository

Shares its history, refs, config and hooks

A separate repository

Local clones hardlink object files; origin is the source folder

A separate repository, history included

A copy of .git, minus the original's worktree entries

Starting point

A commit, usually on a new branch

Files exactly as they were committed

The last commit on your branch

A fresh checkout; your working folder isn't copied

Your folder as it is right now

Pull latest changes, on by default, tries to fast-forward it

Same branch twice

Refused by default

fatal: 'main' is already used by worktree

Yes

It has its own refs

Yes, on your current branch

Each copy has its own refs

.env and ignored files

Left behind

Only tracked files are checked out

Left behind

Only committed files come across

Copied

Except folders named like caches: .next, dist, build, out, target

node_modules

Install again

One npm install per worktree

Install again

Plus .env and any other local setup

Copied, copy-on-write on APFS

Or installed fresh with Reinstall dependencies

Uncommitted edits

Stay in the original folder

Commits are shared between worktrees; working files aren't

Stay in the original folder

Commit first, then fetch them into the clone

Come along by default

Committed work only drops them and keeps .env

Agent launch

Not part of Git

Open each worktree and start the agent yourself

Not part of Git

Script it yourself, once per clone

An action or command on each copy

Plus a prompt for Claude Code, Codex, Gemini or OpenCode

Ports and databases

Shared

Two dev servers still want port 3000

Shared

Same ports, same local database

Shared

lpm checks declared ports on start: Stop & start or Cancel

Disk

Working files only

History stays in the original repository

Working files, history hardlinked

About a worktree's size when cloned on the same disk

Copy-on-write clone on APFS

Shares unchanged blocks; a full copy where cloning isn't supported

Removal

git worktree remove

Refuses unclean worktrees unless forced; the branch stays

Delete the folder

Nothing else refers to it

Delete it from the sidebar

Deleted from disk for good, not moved to the Trash

The lpm column assumes the project folder is the repository root. If the project is a subfolder of a larger repository, the copy is a plain folder next to it, inside that same repository, with no .git of its own.

Facts checked . Git output comes from Git 2.50; every lpm card and row was read from the app's source code.

How lpm Duplicate works

One dialog instead of a worktree setup script

Set the count, the options and the task once, and lpm makes each copy and starts the task in it.

  1. Right-click, Duplicate

    Right-click the project in lpm's sidebar and choose Duplicate. New worktree, right below it, opens the same dialog but makes linked worktrees on fresh branches.

  2. Choose what comes along

    By default a copy keeps your uncommitted edits, .env and node_modules, and tries to fast-forward to the newest commits. Switch on Committed work only, turn off Pull latest changes or switch on Reinstall dependencies for a Node project. Build output and caches like .next, dist and target are always left behind.

  3. Run an agent in every copy

    Pick what starts in each copy: nothing, one of the project's actions or a command like claude, plus an optional prompt for the agent. Make up to 50 copies at once; they nest under the original in the sidebar, or in a folder you name. Review each copy's diff, keep the one that works and delete the rest.

Duplicate

Create standalone copies of shop to run agents or services in parallel.

Copies
3 copies
Folder name (optional)

Name a folder above to keep the copies together in the sidebar, or leave it blank. Use the menu beside a copy to run a different action or command on it.

Starts on each copy in the background as soon as it's created.

Sent to each copy's terminal once it's ready. Leave blank to send nothing.

The Duplicate dialog, as it appears in lpm. Try the stepper.
Choose the right tool

When a Git worktree is still the better choice

A worktree is the lighter tool when a clean branch is all you need. Here is when to reach for one, and what to know before you duplicate.

Pick a Git worktree when…

  • You only need another branch. Reviewing a pull request's code or cherry-picking a fix doesn't need your .env or installed packages.

  • Minimal disk and one shared history matter most. Git stores each object once, and a commit made in any worktree is visible from all of them.

  • Your setup is already scripted. A post-checkout hook or a setup script already copies .env and installs dependencies in every new checkout.

  • You're on a system lpm doesn't support. lpm's desktop app needs macOS, Windows 11 on x64, or 64-bit x86 Linux as new as Ubuntu 22.04. Git worktrees work anywhere Git does.

Know before you duplicate

  • Ports and database servers stay shared

    A copy runs on the same machine, so it wants the same ports and the same local database. Docker Compose names containers after the folder by default, but published ports still collide. lpm checks declared ports on start and, by default, offers Stop & start or Cancel.

  • Disk use grows as copies change

    On APFS a copy starts as a copy-on-write clone that shares unchanged blocks. Edits, builds and fresh installs take real space, and a disk that can't clone gets a full copy.

  • Folders named like build output are skipped

    Folders such as .next, dist, build, out and target are left out at any depth, even when Git tracks them.

  • Deleting a copy is permanent

    Its folder is deleted from disk, not moved to the Trash. Push or merge anything you want to keep first.

  • Some projects can't be duplicated

    SSH projects can't. A project that is itself a linked Git worktree uses New worktree instead.

FAQ

Git worktree alternative FAQ

  • What is the difference between git worktree and git clone?

    A worktree is another working directory attached to the same repository. It shares the object store, branches, stash, config and hooks, and by default Git won't check out one branch in two worktrees. A clone is a separate repository with its own refs and config, so it can sit on any branch. Cloning from a local path hardlinks the object files when it can, so the history takes little extra disk. Neither brings ignored files such as .env or node_modules.

  • What are the limitations of git worktree?

    A new worktree checks out tracked files from a commit, so .env files, node_modules and uncommitted edits stay behind. By default Git refuses a branch that another worktree already has checked out. All worktrees share one repository's config, hooks and stash, and by default they link to it by absolute path, so moving the main folder breaks them until you run git worktree repair. Ports and local database servers stay shared, as they do with clones and copies.

  • Can I copy a Git repository folder instead of using a worktree?

    Yes. A copy of the whole folder, .git included, is an independent repository with the same history, branch and remotes, plus every uncommitted and ignored file. Copy the main checkout, not a linked worktree: a worktree's .git is only a pointer file, so its copy would share the original worktree's HEAD and index. On APFS, cp -c -R makes a fast copy-on-write clone. Then delete the copy's inherited .git/worktrees and drop build caches such as .next. lpm Duplicate does both for you.

  • How can two agents work on the same branch at once?

    Give each agent its own repository. By default, Git won't check out a branch that another worktree already has, but a clone or a full copy has its own refs, so every copy can sit on the same branch. Let each agent attempt the task, keep the result you want, and push only that one. Copies made with lpm Duplicate stay on the original's branch and, by default, carry your uncommitted edits, so every agent starts from your work in progress, not from the last commit.

  • What can I use instead of claude --worktree?

    Claude Code runs in any folder, such as a clone or a copy. By default, claude --worktree branches from your repository's default branch and checks out tracked files only. A .worktreeinclude file copies selected ignored files such as .env, and a WorktreeCreate hook replaces git worktree with your own script. lpm Duplicate makes up to 50 copies of the project as it is on disk and can start Claude Code or Codex with a prompt, or any other command, in each.

  • Does lpm Duplicate copy uncommitted changes, .env files and node_modules?

    Yes, by default. A copy starts as the project on disk, so uncommitted edits, untracked files, ignored files such as .env, and installed node_modules all come along. Folders named like build output or caches, such as .next, dist, build, out and target, are left behind at any depth, even if Git tracks them. Committed work only resets tracked changes and removes untracked files, but keeps ignored ones. Reinstall dependencies leaves node_modules behind and runs a fresh install in Node projects. Pull latest changes, on by default, tries to fast-forward the copy's branch.

  • How much disk space does a project copy use?

    On APFS (macOS), lpm makes a copy-on-write clone, so the copy shares its unchanged file blocks with the original instead of storing them twice. Space grows as files in the copy change, as builds write new caches, and when Reinstall dependencies writes a fresh node_modules. Build caches such as .next are skipped rather than cloned. On Linux, btrfs and XFS can share blocks the same way. Everywhere else, including ext4 and Windows, the copy is a full copy.

  • How do I get changes from a copy back into my main project?

    A copy is its own repository with the same remotes, so commit on a branch there and push it, then merge or open a pull request as usual. You can also fetch straight from its folder, for example git fetch ../shop-k3Fq9Z my-branch, and merge the result. In lpm, the copy's Review changes tab shows its diff, and its Git menu can commit, push and create a pull request. Deleting a copy is permanent, so push first.

  • Is lpm Duplicate based on git worktree?

    No. Duplicate copies the project folder, as a copy-on-write clone on APFS. When the folder is the repository root, the copy gets its own .git with the same history, branch and remotes, not a link back to the original, and lpm removes the worktree entries it inherited from the original. New worktree, the menu item next to Duplicate, is the one that runs git worktree add.

  • Can lpm create real Git worktrees too?

    Yes. Right-click a project and choose New worktree. lpm runs git worktree add on a fresh lpm/<name> branch from the commit you're on, with the same count, label and task options as Duplicate and an optional dependency install. Uncommitted and ignored files stay behind, as with plain Git. Removing an lpm worktree deletes its folder and its branch, even if the branch isn't merged, so push or merge first.

  • Can every project be duplicated?

    Local projects can, and so can projects on a connected Linux server or another connected computer. Folders that aren't Git repositories work too; the Git options are skipped. SSH projects can't be duplicated, and a project that is itself a linked Git worktree has to use New worktree instead. New worktree needs the project folder to be the root of a Git repository with at least one commit.

Give every agent the whole project. Not just another checkout.

lpm is free and open source. Download it and turn the project already on your disk into standalone copies for Claude Code, Codex and any other terminal agent.