Git Worktree vs Clone: Which Should You Use?
When you need to work on multiple branches simultaneously, you have two options: create a git worktree or clone the repository a second time. Both give you a separate working directory, but they work very differently under the hood. This page breaks down the trade-offs so you can choose the right approach.
Comparison at a Glance
| Aspect | Git Worktree | Git Clone (separate copy) |
|---|---|---|
| Disk space | Only the working tree files — all Git objects are shared with the main worktree | Full copy of the entire repository including all Git objects |
| Git history sync | Instant — commits made in one worktree are visible in all others immediately | Manual — you must git fetch or git pull to sync between clones |
| Shared refs | Yes — branches, tags, stashes, and reflog are shared | No — each clone has its own refs; they are independent repositories |
| Setup speed | Near-instant (git worktree add takes milliseconds) | Slow for large repos — must download all objects over the network (or copy locally) |
| Independence | Linked — deleting the main worktree can break linked worktrees | Fully independent — each clone stands on its own |
| Branch restriction | A branch can only be checked out in one worktree at a time | No restriction — the same branch can be checked out in multiple clones |
When to Use Git Worktree
- You want a second working directory fast without waiting for a clone to finish.
- Disk space matters — worktrees share the object store, so a 10 GB repo only costs the size of the checked-out files per worktree.
- You want commits to be visible everywhere instantly without pushing and pulling.
- You are working on a hotfix and a feature at the same time within the same project.
When to Use a Separate Clone
- You need full independence — for example, testing a destructive operation like
git filter-branchwithout risking your main repo. - You want the same branch checked out in two places at once (worktrees do not allow this).
- You are working across machines and need a separate copy on each.
- You want completely isolated Git configuration (hooks, config settings, etc.).
Practical Examples
Creating a Worktree vs Cloning
Using git worktree (fast, lightweight)
# From your existing repo:
git worktree add ../project-hotfix hotfix/login-bug
# Done in milliseconds. ../project-hotfix shares
# the same .git objects as your main checkout.Using git clone (full copy)
# Creates a completely independent copy:
git clone https://github.com/you/project.git ../project-hotfix
# Must wait for the download to finish.
# The two repos are completely separate.Syncing Changes Between Two Clones
With separate clones, you need to push and fetch to share work:
# In clone A:
git commit -am "Fix login bug"
git push origin hotfix/login-bug
# In clone B:
git fetch origin
git log origin/hotfix/login-bugWith worktrees, none of this is needed. A commit made in one worktree is visible in all others immediately because they share the same object store and refs:
# In worktree A (on hotfix/login-bug):
git commit -am "Fix login bug"
# In worktree B (on main):
git log hotfix/login-bug # Already has the commitDisk Space Comparison
# Check the size of the .git directory (shared by all worktrees):
du -sh .git
# 850M .git
# A worktree only adds the checked-out files:
du -sh ../feature-worktree --exclude=.git
# 120M ../feature-worktree
# A full clone duplicates everything:
du -sh ../project-clone
# 970M ../project-cloneRelated Pages
- What Is Git Worktree? — A beginner-friendly introduction
- Worktree vs Branch — How worktrees and branches relate
- git worktree add — How to create a new worktree