git worktree commands.
Why worktrees
Running two agents on the same working tree creates conflicts: one agent’s file edits can interfere with another’s. Worktrees solve this by giving each agent its own directory and branch:- Isolate experimental or risky changes from your main branch
- Run agents on different features simultaneously and compare results
- Keep a clean base branch while an agent works in a worktree
Creating a worktree
Open your repository in Codeg
Open the root of a git repository as a folder in Codeg. The version control panel becomes available in the sidebar.
Go to the version control panel
Click the Version Control icon in the sidebar to open the git panel.
Create a new worktree
Click New Worktree, enter a branch name, and optionally set a parent branch to base the new branch on. Codeg runs
git worktree add in the background and creates the new directory alongside your repository.Parent branch
When you create a worktree, you can set a parent branch — the branch the worktree’s new branch is based on and where you intend to merge back. Codeg records the parent branch so the merge workflow knows the target. You can also set or update the parent branch for any open folder from the version control panel at any time.Merging back
Once an agent completes its work in a worktree, use Codeg’s built-in merge tools to integrate the changes:Open the merge window
From the worktree folder, open Version Control > Merge. The merge window shows the diff between the worktree branch and the parent branch.
Resolve any conflicts
If there are conflicts, Codeg’s conflict resolution view shows each conflicting file with the local, remote, and base versions side by side. Accept one side or edit the merged result directly.
Built-in git operations
The version control panel exposes a full set of git operations for each open folder or worktree:Commits
Stage files, write a commit message, and commit — with support for amending and signing.
Branches
Create, checkout, rename, and delete local branches. Delete remote branches when you’re done.
Push and pull
Push to remotes, pull with merge or rebase, fetch individual remotes, and view ahead/behind counts.
Stash
Push, pop, apply, show, and drop stash entries without leaving the workspace.
Merge and rebase
Merge branches, rebase, abort or continue in-progress operations, and resolve conflicts file by file.
Diff and log
View file diffs, compare branches, inspect the commit log, and show individual commits.