worktree-pr-merge

Community

Coordinate Git worktrees to merge PRs safely.

Authorusepowershell
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Git worktrees enable parallel PR development by creating isolated branch checkouts tied to the main worktree. Merging PRs sequentially to main requires coordinating state across worktrees to avoid build failures, false exit codes, and branch push issues. This skill codifies the recurring patterns that ensure deterministic merges and reliable automation.

Core Features & Use Cases

  • Rebase timing: Ensure subsequent worktrees rebase after each preceding PR lands to main.
  • Dotnet restore on cold worktrees: Run dotnet restore before dotnet test --no-restore when a worktree has never been built to avoid NETSDK1004.
  • Correct interpretation of gh pr merge exit codes: The local branch-delete step may fail with non-zero exit while the merge succeeded on GitHub; do not treat this as a failure.
  • Force-push with explicit remote: When a worktree branch has no upstream, use explicit remote reference: git push --force-with-lease origin <branch>.
  • Sequential merge discipline: When multiple PRs touch the same files, merge them to main sequentially to avoid conflicts.

Quick Start

Start by updating the main worktree, then merge subsequent PRs sequentially and rebase after each merge.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: worktree-pr-merge
Download link: https://github.com/usepowershell/PoshMcp/archive/main.zip#worktree-pr-merge

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.