Checkout PR branches from GitHub and add to machete layout
Checks out GitHub PR branches and adds them to git-machete stack layout
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemint[--mine | --all | --by=<user> | PR numbers]git/stacked/<butler_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/gitbutler-context.sh
</butler_context>
<worktree_status>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/worktree-context.sh 2>&1
</worktree_status>
<stack_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/machete-context.sh 2>&1
</stack_context>
<gitbutler_incompatible>
This command does not work with GitButler.
If GITBUTLER_ACTIVE=true from <butler_context>:
Stacked branches (git-machete) are not compatible with GitButler virtual branches.
GitButler has its own stacking system. Use these instead:
- `crew:git:butler:status` - View virtual branches
- `crew:git:butler:branch` - Create virtual branch
- `crew:git:butler:sync` - Sync with upstream
To use machete, first disable GitButler in this repository.
Exit immediately. Do not proceed with machete commands.
</gitbutler_incompatible>
<objective>Checkout PR branches from GitHub and add them to the machete layout.
</objective> <workflow>If no argument:
AskUserQuestion({
questions: [
{
question: "Which PRs do you want to checkout?",
header: "PRs",
options: [
{
label: "My PRs (Recommended)",
description: "All open PRs authored by you",
},
{
label: "All open PRs",
description: "All open PRs in the repository",
},
{ label: "Specific PRs", description: "Enter PR numbers" },
{ label: "By author", description: "PRs by a specific user" },
],
multiSelect: false,
},
],
});
# My PRs
gh pr list --author @me --state open --json number,title,headRefName
# All open PRs
gh pr list --state open --limit 20 --json number,title,headRefName,author
# By author
gh pr list --author "$username" --state open --json number,title,headRefName
My PRs:
git machete github checkout-prs --mine
All open PRs:
git machete github checkout-prs --all
Specific PRs:
git machete github checkout-prs 123 456 789
By author:
git machete github checkout-prs --by=username
git machete status --list-commits
AskUserQuestion({
questions: [
{
question: "Sync the checked-out stack with latest changes?",
header: "Sync",
options: [
{ label: "Yes", description: "Run traverse to sync all branches" },
{ label: "No", description: "Keep branches as-is" },
],
multiSelect: false,
},
],
});
If yes: Skill({ skill: "crew:git:stacked:traverse" })
When checking out someone else's PRs, branches are annotated:
feature-branch PR #123 rebase=no push=no
rebase=no — Don't rebase (you don't own it)push=no — Don't push (you don't own it)To remove qualifiers: git machete anno <branch> ""
<success_criteria>
</success_criteria>