Skip to content
Skills Library
Programming · Automation

git-wtpr

/git-wtpr

Opens or deletes a git-wt worktree for a GitHub pull request. Use when creating, switching to, or removing a PR worktree.

Repository
dotfiles ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Opens or deletes a git-wt worktree for a GitHub pull request. Use when creating, switching to, or removing a PR worktree.

Original author description

Opens or deletes a git-wt worktree for a GitHub pull request. Use when creating, switching to, or removing a PR worktree.

How it works

  1. Usage
  2. Behaviour
  3. Workflow for agents
  4. Related
Original SKILL.md headings · 58 lines, 314 words
SKILL.md preview
---
name: git-wtpr
description: Opens or deletes a git-wt worktree for a GitHub pull request. Use when creating, switching to, or removing a PR worktree.
---

# Git Worktrees for Pull Requests (git-wtpr)

Use `git wtpr` to create or switch to a worktree checked out at a PR head.
Builds on `git-wt` — prefer this over `gh pr checkout` when isolation in a
worktree is needed.

## Usage

```sh
git wtpr <number|url> [git-wt flags...]
git wtpr <number|url> -d | -D
```

Examples:

```sh
git wtpr 25
git wtpr https://github.com/owner/repo/pull/3984
git wtpr 25 -D                                    # remove that PR worktree
```

Interactive use (with `git-wtpr --init fish`) **cds into the worktree**,
same as `git wt`. Do not pass `--nocd` unless you only need the path.

Confirm availability with `command -v git-wtpr` or `git-wtpr --help`.

## Behaviour

1. Resolves the PR with `gh pr view` (number or URL).
2. Ensures the current clone matches the PR repository.
3. Fetches `pull/<n>/head` from the remote.
4. Creates or switches a worktree via `git wt` on the PR head branch name.
5. If the head branch is `main`/`master`, uses `pr-<number>` instead.
6. Shell integration cds into that worktree (unless `--nocd` / `wt.nocd`).

Status goes to stderr. The worktree path is the last stdout line.

With `-d` (safe) or `-D` (force) the PR worktree and its branch are
deleted instead — the PR is still resolved to get the branch name, but
step 3 is skipped.

## Workflow for agents

1. Run from the correct repository clone (not a random directory).
2. Use `git wtpr --nocd <pr>` — shell `cd` does not persist across tool
   calls, so capture the printed path and use it as the working directory.
3. Verify inside the worktree: `git branch --show-current` and
   `git status --short`.
4. To clean up afterwards, run `git wtpr <pr> -D` from the same clone (or
   `git wt -D <branch>`). For other lifecycle operations (list, rename),
   use the `git-wt` skill.

## Related

- `git-wt` skill for worktree create/switch/delete/rename
- `agents/shared/git-worktrees.md` for when not to create a new worktree

Versions

The database has no other skills named git-wtpr.

Database snapshot: 13.11.2026 · package version 426e0ca0c333 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100worktree
    Manages git worktrees with git-wt, including PR checkouts. Use when the user asks to create, switch, or delete a worktree, or check out a PR.
  • 95git-worktree
    This skill should be used when managing Git worktrees for isolated parallel development. It handles creating, listing, switching, and cleaning up worktrees with a simple interactive interface.
  • 100cleanup-github-worktree
    清理长时间未使用的 git worktree(GitHub 版)。仅在用户明确要求清理 worktree 时使用,不自动触发。 关键词:清理 worktree、删除 worktree、移除旧分支、worktree 回收。
  • 100git-worktree-finish
    Use when the user asks to finish, land, or merge back a feature worktree created with /git-worktree.
  • 90git-github-workflows
    Use when committing, opening a PR, driving it to merge, answering reviewer or AI-bot feedback, working in a worktree, cutting a release, or cleaning up branches. Not for command flags (git worktree, gh pr: working-with-git, working-with-github), CI workflow YAML…
  • 100worktree
    Creates new git worktree with symlinked/copied assets and independent environment setup. Triggers on keywords: worktree, create worktree, new worktree, git worktree

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.