Assign files to a GitButler virtual branch
Assigns files to GitButler virtual branches or performs branch operations.
/plugin marketplace add settlemint/agent-marketplace/plugin install crew@settlemint<file> <branch>git/butler/<butler_context>
!${CLAUDE_PLUGIN_ROOT}/scripts/git/gitbutler-context.sh
</butler_context>
Manually assign files to a virtual branch using the rub command.
If GITBUTLER_ACTIVE=false:
GitButler is not initialized. File assignment requires GitButler.
Exit if not active.
but branch list
If both file and branch provided, proceed.
Otherwise:
AskUserQuestion({
questions: [
{
question: "What operation?",
header: "Operation",
options: [
{
label: "Assign file to branch",
description: "Move file to specific branch",
},
{
label: "Unassign file",
description: "Remove file from all branches",
},
{ label: "Move commit to branch", description: "Relocate a commit" },
{ label: "Squash commits", description: "Combine two commits" },
],
multiSelect: false,
},
],
});
Assign file to branch:
but rub ${file} ${branch}
Unassign file:
but rub ${file} 00
Move commit to branch:
but rub ${commitSha} ${branch}
Squash commits:
but rub ${commit1} ${commit2}
but branch list
</workflow>
<rub_reference>
| Operation | Command | Result |
|---|---|---|
| Assign file | but rub FILE BRANCH | File moves to branch |
| Unassign | but rub FILE 00 | File becomes unassigned |
| Amend | but rub FILE COMMIT | Add file to commit |
| Move commit | but rub COMMIT BRANCH | Commit moves to branch |
| Squash | but rub COMMIT1 COMMIT2 | Commits combined |
</rub_reference>
<success_criteria>
</success_criteria>