# Git worktrees: How to work on multiple branches at once

DevFeed: [Git worktrees: How to work on multiple branches at once](<https://devfeed.tech/articles/git-worktrees-how-to-work-on-multiple-branches-at-once-98648.md>)

Original publisher: [Read original article](<https://circleci.com/blog/git-worktree/>)

Author: Jacob Schmitt

Published: 2026-10-23T16:00:00Z

Content type: tutorial

Language: en

Sources: [CircleCI](<https://devfeed.tech/sources/the-circleci-blog-feed-circleci.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [Parallelism](<https://devfeed.tech/topics/parallelism.md>), [CI/CD](<https://devfeed.tech/topics/cicd.md>), [Pull Request](<https://devfeed.tech/topics/pull-request.md>), [developer-productivity](<https://devfeed.tech/topics/developer-productivity.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-development](<https://devfeed.tech/tags/ai-development.md>), [branch](<https://devfeed.tech/tags/branch.md>), [circleci](<https://devfeed.tech/tags/circleci.md>), [codex](<https://devfeed.tech/tags/codex.md>), [coding](<https://devfeed.tech/tags/coding.md>), [coding-agent](<https://devfeed.tech/tags/coding-agent.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [engineering-productivity](<https://devfeed.tech/tags/engineering-productivity.md>), [git](<https://devfeed.tech/tags/git.md>), [git-remove-worktree](<https://devfeed.tech/tags/git-remove-worktree.md>), [git-worktree](<https://devfeed.tech/tags/git-worktree.md>), [git-worktree-add](<https://devfeed.tech/tags/git-worktree-add.md>), [git-worktree-tutorial](<https://devfeed.tech/tags/git-worktree-tutorial.md>), [git-worktree-vs-branch](<https://devfeed.tech/tags/git-worktree-vs-branch.md>), [git-worktrees](<https://devfeed.tech/tags/git-worktrees.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [how-to-use-git-worktree](<https://devfeed.tech/tags/how-to-use-git-worktree.md>), [parallel](<https://devfeed.tech/tags/parallel.md>), [what-is-a-git-worktree](<https://devfeed.tech/tags/what-is-a-git-worktree.md>)

## AI overview

Git worktrees provide separate working directories and staging areas for multiple branches while sharing one repository's history, avoiding repeated branch switching or duplicate clones. Create, inspect, and remove them with `git worktree add`, `list`, and `remove`; branches can only be checked out in one worktree at a time. For coding agents, assign independent tasks to separate worktrees, review committed and uncommitted changes, confirm checks, then merge and clean up. Tool workflows differ: Claude Code and Codex support `.worktreeinclude` for ignored files, Cursor can run setup commands from `.cursor/worktrees.json`; Codex offers "Create branch here," and Cursor has `/apply-worktree`. Worktrees do not isolate shared ports, databases, services, credentials, or overlapping code, so separate environments may be needed and merge conflicts remain possible. Keep tasks small, limit work in progress, and merge regularly. CircleCI's CLI and MCP tools provide CI logs and failures to agents; its CLI `--failure-report` gathers failures across jobs.

## Source excerpt

Learn how git worktrees let you work on several branches at once, how to set each one up, and how to keep parallel work from piling up unmerged.