Git Worktrees
Git Worktrees
Start with meaning, then move to detail.
This lesson explains Git Worktrees as part of using Hermes and understanding its behavior. You will learn what it does, when it matters, and the smallest safe test that proves it works.
If you are new, do not memorize names. Focus on three questions: what problem does this solve, what access does it need, and how can you verify the result?
For practice, inspect the first example, identify its effects, run it on test data, and compare the result with the source claim.
For advanced readers, inspect Why Use Worktrees with Hermes?, Quick Start: Creating a Worktree, Running Multiple Agents in Parallel, then verify failure modes and version compatibility.
Start with installation if you have not run Hermes yet.
A clear outcome before you read.
- Understand Git Worktrees without assumed prior knowledge.
- Separate the source description from what still needs testing in your environment.
- Read the first command and identify its inputs and outputs before copying it.
Run multiple Hermes agents safely on the same repository using git worktrees and isolated checkouts
What does the source say, and in what order?
- 01Why Use Worktrees with Hermes?
Start here to understand the core idea or structure.
- 02Quick Start: Creating a Worktree
Read this after the foundation, then connect it to the previous step.
- 03Running Multiple Agents in Parallel
Read this after the foundation, then connect it to the previous step.
- 04Cleaning Up Worktrees Safely
Read this after the foundation, then connect it to the previous step.
- 05Best Practices
Read this after the foundation, then connect it to the previous step.
- 06Using hermes -w (Automatic Worktree Mode)
Read this after the foundation, then connect it to the previous step.
- 07Putting It All Together
Read this after the foundation, then connect it to the previous step.
- 08Developing the UI surfaces across worktrees
Finish here to verify the result and special cases.
Copy only after you understand the effect.
# From the main repo root
cd /path/to/your/repo
# Create a new branch and worktree in ../repo-feature
git worktree add ../repo-feature feature/hermes-experimentcd ../repo-feature
# Start Hermes in the worktree
hermescd /path/to/your/repo
git worktree add ../repo-experiment-a feature/hermes-a
git worktree add ../repo-experiment-b feature/hermes-bRead the first command and identify its inputs and outputs before copying it.
Match every command to your installed Hermes version, review the files and accounts it can reach, and use non-sensitive data for the first test. If this explanation differs from the source, the official source wins.