app/worktrees.md +2 −14
1# Worktrees1# Worktrees
2 2
3Leverage Git worktrees within the Codex app to let Codex work in parallel
4
5In the Codex app, worktrees let Codex run multiple independent tasks in the same project without interfering with each other. For Git repositories, [automations](https://developers.openai.com/codex/app/automations) run on dedicated background worktrees so they don’t conflict with your ongoing work. In non-version-controlled projects, automations run directly in the project directory. You can also start threads on a worktree manually.3In the Codex app, worktrees let Codex run multiple independent tasks in the same project without interfering with each other. For Git repositories, [automations](https://developers.openai.com/codex/app/automations) run on dedicated background worktrees so they don’t conflict with your ongoing work. In non-version-controlled projects, automations run directly in the project directory. You can also start threads on a worktree manually.
6 4
7## What's a worktree5## What's a worktree
55 53
56You can open your IDE to the worktree using the "Open" button in the header, use the integrated terminal, or anything else that you need to do from the worktree directory.54You can open your IDE to the worktree using the "Open" button in the header, use the integrated terminal, or anything else that you need to do from the worktree directory.
57 55
5856 
59
60 
61 57
62Remember, if you create a branch on a worktree, you can't check it out in any other worktree, including your local checkout.58Remember, if you create a branch on a worktree, you can't check it out in any other worktree, including your local checkout.
63 59
74- **Overwrite**: Makes the destination checkout match the source checkout’s files and commit history.70- **Overwrite**: Makes the destination checkout match the source checkout’s files and commit history.
75- **Apply**: Calculates the source changes since the nearest shared commit and applies that patch onto the destination checkout, preserving destination commit history while bringing over source code changes (not source commits).71- **Apply**: Calculates the source changes since the nearest shared commit and applies that patch onto the destination checkout, preserving destination commit history while bringing over source code changes (not source commits).
76 72
7773 
78
79 
80 74
81You can create multiple worktrees and sync them to the same feature branch to split up your work into parallel threads.75You can create multiple worktrees and sync them to the same feature branch to split up your work into parallel threads.
82 76
151is cleaned up. However, Codex saves a snapshot of the worktree prior to145is cleaned up. However, Codex saves a snapshot of the worktree prior to
152cleaning it up and offers to restore it if you reopen the thread associated146cleaning it up and offers to restore it if you reopen the thread associated
153with it.147with it.
154
155[Previous
156
157Automations](https://developers.openai.com/codex/app/automations)[Next
158
159Local Environments](https://developers.openai.com/codex/app/local-environments)