Skip to main content

gh-pr-merge-in-worktrees

Recover from `gh pr merge --delete-branch` appearing to fail inside a git worktree. Use when: (1) `gh pr merge 2 --delete-branch` prints `failed to run git: fatal: '<branch>' is already used by worktree at '<path>'`, (2) you suspect the PR merged anyway despite the error, (3) you see a merged PR with its remote branch still present on origin, (4) working in any multi-worktree setup where `main` is checked out in a sibling worktree. Explains that `gh pr merge --delete-branch` runs three separable steps (API merge, local delete, remote delete) and the middle step failing leaves the merge state inconsistent with the branch-cleanup state.

Jump to install

Source facts

Repository
cajias/claude-skills
Last source activity
July 20, 2026 at 07:29
Detected SKILL.md language
English
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.