Remove merged branches from stack, reconnect children, and update PRs
Removes merged branches from stack, reconnects children, and updates PRs
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemintgit/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>Remove merged branches from machete layout, reconnect children to parent.
</objective> <workflow>git machete status
Look for gray edges (o) indicating merged branches.
If in a worktree, cannot slide out:
AskUserQuestion({
questions: [
{
question: "You're in a worktree. Which branch to slide out?",
header: "Branch",
options: [
{
label: "A different branch",
description: "Slide out a branch NOT checked out in any worktree",
},
{
label: "Show worktree list",
description: "See which branches have worktrees",
},
],
multiSelect: false,
},
],
});
git machete slide-out <branch> --no-rebase # For remote merges
git machete slide-out <branch> --delete # Also delete local
if git machete is-managed "$(git branch --show-current)" 2>/dev/null; then
git config machete.github.prDescriptionIntroStyle full
git machete github retarget-pr --branch "$(git machete show down 2>/dev/null | head -1)" 2>/dev/null || true
git machete github update-pr-descriptions --related
fi
git machete traverse -W -y -H
</workflow>
<success_criteria>
</success_criteria>