# Cmd Worktree Merge

> Merge all worktrees from .trees/ into current branch and clean up

- Skill: `gsmlg-dev/cmd-worktree-merge` (Agent Skill)
- Install (CLI): `npx skillmds@latest add gsmlg-dev/cmd-worktree-merge`
- Raw SKILL.md: https://api.skillmd.com/api/skills/gsmlg-dev/cmd-worktree-merge/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: gsmlg-dev (https://skillmd.com/u/gsmlg-dev)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/gsmlg-dev/cmd-worktree-merge

---


Merge all git worktrees under the `.trees/` directory into the current branch.

## Steps

1. Run `git worktree list` to identify worktrees in `.trees/`.
2. For each worktree (in alphabetical order):
   a. Get its branch name from `git worktree list`.
   b. Run `git merge <branch> --no-edit`.
   c. If conflicts arise, analyze and resolve them, preferring to combine both sides when possible.
   d. After successful merge, run `git worktree remove <path>` and `git branch -d <branch>`.
3. Verify final state with `git status` and `git log --oneline -n 10`.

{{INPUT}}

