Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Using Codex Worktrees

Using Codex Worktrees

Worktrees let you create multiple working directories in a Git repository, enabling you to work on different tasks in parallel without interfering with each other.


What is a worktree?

Git worktree is a Git feature that lets you create multiple working directories in the same repository. Codex provides native support for worktrees.

Use Cases

Worktrees let you work as if you had multiple computers at once.


Using worktrees in Codex

Create a worktree

Create a worktree

Create a worktree in the Codex app

1. Select a project

2. Click "New" -> "Worktree"

3. Enter a branch name

4. Click create

Run tasks in a worktree

Select worktree mode when creating a thread:

Mode Description
Local Work in the current project directory
Worktree Work in a separate Git worktree

Worktree mode creates a new Git worktree, keeping changes isolated.


Worktree management

Manage worktrees

View the worktree list

git

worktree list

Create a new worktree

git

worktree add ..

/

feature-branch

-b

feature-branch

Delete a worktree

git

worktree remove ..

/

feature-branch


Best Practices

Worktrees are a powerful tool for parallel development, especially suitable for large projects.